Part Number Hot Search : 
2N5793 SI9435DY 1N3995A TSS461C RT1N241S 3181K RT1N241S 162VTRA
Product Description
Full Text Search
 

To Download ADUC7121 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  precision analog microcontroller, 12-bit analog i/o, arm7tdmi mcu ADUC7121 rev. 0 information furnished by analog devices is believed to be accurate and reliable. however, no responsibility is assumed by analog devices for its use, nor for any infringements of patents or other rights of third parties that may result from its use. specifications subject to change without notice. no license is granted by implication or otherwise under any patent or patent rights of analog devices. trademarks and registered trademarks are the property of their respective owners. one technology way, p.o. box 9106, norwood, ma 02062-9106, u.s.a. tel: 781.329.4700 www.analog.com fax: 781.461.3113 ?2011 analog devices, inc. all rights reserved. features analog input/output 9-channel, 12-bit, 1 msps adc 2 differential pairs with input pga 7 general-purpose inputs (differential or single-ended) fully differential and single-ended modes 0 v to v ref analog input range 5 low noise current digital-to-analog converters (idacs) 250 ma, 200 ma, 80 ma, 45 ma, 20 ma 4 12-bit voltage output dacs on-chip voltage reference on-chip temperature sensor microcontroller arm7tdmi core, 16-bit/32-bit risc architecture jtag port supports code download and debug clocking options trimmed on-chip oscillator (3%) external watch crystal external clock source up to 41.78 mhz 41.78 mhz pll with programmable divider memory 126 kb flash/ee memory, 8 kb sram in-circuit download, jtag-based debug software-triggered in-circuit reprogrammability on-chip peripherals uart, 2 i 2 c and spi serial i/o 32-pin gpio port 4 general-purpose timers wake-up and watchdog timers (wdt) power supply monitor vectored interrupt controller for fiq and irq 8 priority levels for each interrupt type interrupt on edge or level external pin inputs power specified for 3 v operation active mode: 11 ma at 5 mhz, 40 ma at 41.78 mhz packages and temperature range 7 mm 7 mm 108-ball csp_bga fully specified for C10c to +95c operation tools low cost quickstart development system full third party support applications optical modulestunable laser functional block diagram ADUC7121 dac buf dac buf dac buf dac buf iognd iovdd xtali xtalo tdo tdi tck tms trst rst pla pll por osc pwm 3 gp timers 8kb sram (2k 32-bit) 126kb flash (63k 16-bit) arm7 tdmi wake-up timer gpio control spi i 2 c 2 uart jtag wd timer vic ldo 1msps 12-bit sar adc adc8 adc7 adc6 adc5 adc4 padc1n padc1p padc0n padc0p pga a dc10/aincm adc9 pga temperature sensor internal reference v ref _1.2 v ref _2.5 buf p0.0 to p0.7 p1.0 to p1.7 p2.0 to p2.7 p3.0 to p3.7 a v dd 3.3v agnd dac0 dac1 dac2 dac3 09492-001 idac0 i dac idac1 i dac idac2 i dac idac 3 i dac idac4 i dac figure 1.
ADUC7121 rev. 0 | page 2 of 96 table of contents features .............................................................................................. 1 applications....................................................................................... 1 functional block diagram .............................................................. 1 revision history ............................................................................... 3 general description ......................................................................... 4 specifications..................................................................................... 5 timing specifications ................................................................ 10 absolute maximum ratings.......................................................... 15 esd caution................................................................................ 15 pin configuration and function descriptions........................... 16 terminology .................................................................................... 20 adc specifications .................................................................... 20 dac specifications..................................................................... 20 overview of the arm7tdmi core............................................. 21 thumb mode (t)........................................................................ 21 long multiply (m)...................................................................... 21 embeddedice (i) ....................................................................... 21 exceptions ................................................................................... 21 arm registers ............................................................................ 22 interrupt latency........................................................................ 22 memory organization ................................................................... 23 memory access........................................................................... 23 flash/ee memory....................................................................... 23 sram ........................................................................................... 23 memory mapped registers ....................................................... 23 complete mmr listing............................................................. 24 adc circuit overview .................................................................. 27 adc transfer function............................................................. 27 temperature sensor ................................................................... 29 converter operation.................................................................. 31 driving the analog inputs ........................................................ 33 band gap reference................................................................... 33 power supply monitor ............................................................... 34 nonvolatile flash/ee memory ..................................................... 35 flash/ee memory overview..................................................... 35 flash/ee memory....................................................................... 35 flash/ee memory security ....................................................... 35 flash/ee control interface........................................................ 36 execution time from sram and flash/ee ........................ 39 reset and remap ........................................................................ 39 other analog peripherals.............................................................. 41 digital-to-analog converters................................................... 41 ldo (low dropout regulator)................................................ 43 current output dacs (idac)................................................. 43 idac mmrs ............................................................................... 45 oscillator and pllpower control........................................ 46 digital peripherals.......................................................................... 50 pwm general overview........................................................... 50 pwm convert start control .................................................... 52 general-purpose input/output.................................................... 53 uart serial interface .................................................................... 58 baud rate generation................................................................ 58 uart register definition......................................................... 58 i 2 c peripherals ................................................................................ 63 serial clock generation ............................................................ 63 i 2 c bus addresses....................................................................... 63 i 2 c registers ................................................................................ 64 i 2 c common registers .............................................................. 72 serial peripheral interface ............................................................. 73 spi miso (master in, slave out) pin...................................... 73 spi mosi (master out, slave in) pin...................................... 73 spiclk (serial clock i/o) pin................................................. 73 spi chip select input pin .......................................................... 73 configuring external pins for spi functionality................... 73 spi registers................................................................................ 73 programmable logic array (pla)............................................... 76 pla mmrs interface................................................................. 77 interrupt system ............................................................................. 80 normal interrupt request (irq) ............................................. 80 fast interrupt request (fiq) .................................................... 81 external interrupts (irq0 to irq3) ........................................ 85 timers .............................................................................................. 87 timer0lifetime timer........................................................... 87 timer1general-purpose timer ........................................... 88 timer2wake-up timer......................................................... 90 timer3watchdog timer........................................................ 91 timer4general-purpose timer ........................................... 93 outline dimensions ....................................................................... 95 ordering guide .......................................................................... 95
ADUC7121 rev. 0 | page 3 of 96 revision history 1/11revision 0: initial version
ADUC7121 rev. 0 | page 4 of 96 general description the ADUC7121 is a fully integrated, 1 msps, 12-bit data acquisi- tion system incorporating a high performance multichannel adc, 16-bit/32-bit mcu, and flash?/ee memory on a single chip. the adc consists of up to seven single-ended inputs and two extra differential input pairs. the two differential pair inputs can be routed through a programmable gain amplifier (pga). the adc can operate in single-ended or differential input mode. the adc input voltage is 0 v to v ref . a low drift band gap ref- erence, temperature sensor, and voltage comparator complete the adc peripheral set. the ADUC7121 provides five curr ent output digital-to-analog converters (dacs). the current sources (five current dacs) feature low noise and low drift high-side current output at 11-bit resolution. the five idacs are as follows: idac0 with 250 ma full-scale (fs) output, idac1 with 200 ma fs output, idac2 with 80 ma fs output, idac3 with 45 ma fs output, and idac4 with 20 ma fs output. the ADUC7121 also contains four voltage output digital-to-analog converters (dacs). the dac output range is programmable to one of three voltage ranges. the devices operate from an on-chip oscillator and a pll generating an internal high frequency clock of 41.78 mhz (uclk). this clock is routed through a programmable clock divider from which the mcu core clock operating frequency is generated. the microcontroller core is an arm7tdmi?, 16-bit/32-bit risc machine, which offers up to 41 mips peak performance. eight kb of sram and 126 kb of nonvolatile flash/ee memory are provided on chip. the arm7tdmi core views all memory and registers as a single linear array. on-chip factory firmware supports in-circuit serial download via the i 2 c serial interface port; nonintrusive emulation is also supported via the jtag interface. these features are incorporated into a low cost quickstart? development system supporting this microconverter? family. the device operates from 3.0 v to 3.6 v, and it is specified over an industrial temperature range of ?10c to +95c. the idacs are powered from a separate 2 v input power supply. when operating at 41.78 mhz, the power dissipation is typically 120 mw. the ADUC7121 is available in a 108-ball chip scale package ball grid array [csp_bga].
ADUC7121 rev. 0 | page 5 of 96 specifications av dd = iov dd = 3.0 v to 3.6 v, pv dd = 2.0 v 5%, v ref = 2.5 v internal reference, f core = 41.78 mhz, t a = ?10c to +95c, unless otherwise noted. table 1. parameter min typ max unit test conditions/comments adc channel specifications eight acquisition clocks and f adc /2 adc power-up time 5 s dc accuracy 1 , 2 resolution 12 bits integral nonlinearity 0.6 2 lsb 2.5 v internal reference, not production tested for padc0 and padc1 channels differential nonlinearity 3 , 4 0.5 +1.4/?0.99 lsb 2.5 v internal reference, guaranteed monotonic dc code distribution 1 lsb adc input is a dc voltage endpoint errors 5 internally unbuffered channels offset error all channels except idacx channels 2 5 lsb idacx channels only 1 % of full scale offset error match 1 lsb gain error 2 5 lsb gain error match 1 lsb dynamic performance f in = 10 khz sine wave, f sample = 1 msps, internally unbuffered channels signal-to-noise ratio (snr) 69 db incl udes distortion and noise components total harmonic distortion (thd) ?78 db peak harmonic or spurious noise ?75 db channel-to-channel crosstalk ?80 db measured on adjacent channels analog input input voltage ranges differential mode v cm 6 v ref /2 v see table 38 single-ended mode 0 to v ref v buffer bypassed 0.15 av dd ? 1.5 v buffer enabled leakage current 0.2 1 a input capacitance 20 pf during adc acquisition buffer bypassed 20 pf during adc acquisition buffer enabled padc0x input 28.3 k resistor, pga gain = 3, acquisition time = 3.2 s, pseudo differential mode full-scale input range 20 1000 a input leakage at padc0x 4 0.15 2 na resolution 11 bits 0.1% accuracy, 5 ppm external resistor for current to voltage gain error 4 1 % gain drift 4 50 ppm/c offset 4 3 6 na pga offset not included offset drift 4 30 60 pa/c padc0x compliant range 0.1 av dd ? 1.2 v
ADUC7121 rev. 0 | page 6 of 96 parameter min typ max unit test conditions/comments padc1 input 53.5 k resistor, pga gain = 3 full-scale input range 10.6 700 a input leakage at padc1x 4 0.15 2 na resolution 11 bits 0.1% accuracy, 5 ppm external resistor for current to voltage gain error 4 1 % gain drift 4 50 ppm/c offset 4 3 6 na pga offset not included offset drift 4 30 60 pa/c padc1x-compliant range 0.1 av dd ? 1.2 v on-chip voltage reference 0.47 f from v ref to agnd output voltage 2.5 v accuracy 7 5 mv t a = 25c reference temperature coefficient 4 10 30 ppm/c power supply rejection ratio 61 db output impedance 10 t a = 25c internal v ref power-on time 1 ms external reference input input voltage range 1.2 av dd v idac channel specifications voltage compliance range 0.4 1.6 v output voltage compliance voltage compliance range, idac0 ?0.2 +1.6 8 v for idac0 channel only, linearity not guaranteed below 0 v reference current generator reference current 0.38 ma using internal reference, 0.1% 5 ppm 3.16 k external resistor temperature coefficient 25 ppm/c using internal reference short-circuit detection 1 ma overheat shutdown 135 c junction temperature resolution 11 bits guaranteed monotonic full-scale output idac4 20 ma idac3 45 ma idac2 80 ma idac1 200 ma idac0 250 ma integral nonlinearity 2 lsb 11-bit mode noise current 20 a rms value, bandwidth 20 hz to 10 mhz full-scale error 3 % v out = 1.6 v full-scale error drift 50 ppm/c internal v ref , 5 ppm external resistor zero-scale error pull-down switch off, v out = 0 v idac4 channel 30 a idac3 channel +42/?70 a idac2 channel +70/?110 a idac1 channel 240 a idac0 channel 250 a output range 0.4 v to 1.6 v +580/?430 a output range ?0.2 v to +1.6 v settling time 1 ms to 0.1% signal bandwidth 20 khz
ADUC7121 rev. 0 | page 7 of 96 parameter min typ max unit test conditions/comments line regulation measured with full-scale current load on current dacs idac4 10 a/v idac3 22.5 a/v idac2 40 a/v idac1 100 a/v idac0 750 a/v load regulation measured with full-scale current load on current dacs idac4 10 a/v idac3 22.5 a/v idac2 40 a/v idac1 100 a/v idac0 750 a/v acpsrr 4 0.75% % of full- scale/v 10 khz, percentage of each current dac full- scale current per volt 6% % of full- scale/v 2.25 mhz, percentage of each current dac full-scale current per volt pull-down nmos 100 mv drain 40 ma speed 4 10 s triggered by pla, draw the pin voltage to 10% of its original value voltage dac (vdac) channel r l = 5 k, c l = 100 pf dc accuracy 9 buffered resolution 12 bits relative accuracy 2 lsb differential nonlinearity 0.2 1 lsb guaranteed monotonic calculated offset error 2 mv 2.5 v internal reference actual offset error 9 mv measured at code 0 gain error 10 0.15 0.8 % gain error mismatch 0.1 % % of full scale on dac0 settling time 10 s psrr 4 buffered dc ?59 ?61 db 1 khz ?57 db 10 khz ?47 db 100 khz ?19 db drift offset drift 4 10 v/c gain error drift 4 10 v/c short-circuit current 20 ma analog outputs output range 0.1 v ref /av dd ? 0.1 buffer on dac ac characteristics slew rate 2.49 v/s voltage output settling time 10 s digital-to-analog glitch energy 20 nv-sec 1 lsb change at major carry (where maximum number of bits simultaneously change in the dacxdat register)
ADUC7121 rev. 0 | page 8 of 96 parameter min typ max unit test conditions/comments temperature sensor 11 after user calibration voltage output at 25c 707 mv voltage temperature coefficient ?1.25 mv/c accuracy 3 c mcu in power-down or standby mode before measurement power supply monitor (psm) iov dd trip point selection 2.79 v two selectable trip points 3.07 v power supply trip point accuracy 2.5 % of the selected nominal trip point voltage power-on reset 2.36 v watchdog timer ( wdt ) timeout period 0 512 sec flash/ee memory endurance 12 10,000 cycles data retention 13 20 years t j = 85c digital inputs all digital inputs excluding xclki and xclko logic 1 input current 0.2 1 a v ih = v dd logic 0 input current ?40 ?60 a v il = 0 v; except tdi input capacitance 10 pf logic inputs 4 all logic inputs excluding xclki v inl , input low voltage 4 0.8 v v inh , input high voltage 4 2.0 v logic outputs all digital outputs excluding xclko v oh , output high voltage 2.4 v i source = 1.6 ma v ol , output low voltage 14 0.4 v i sink = 1.6 ma crystal inputs (xclki and xclko) logic inputs, xclki only v inl , input low voltage 1.1 v v inh , input high voltage 1.7 v xclki input capacitance 20 pf xclko output capacitance 20 pf internal oscillator 32.768 khz 3 % mcu clock rate from 32 khz internal oscillator 326 khz clock divider (cd) = 7 from 32 khz external crystal 41.78 mhz cd = 0 using an external clock 0.05 41.78 mhz t a = 95c start-up time core clock (hclk) = 41.78 mhz at power-on 70 ms from pause/nap mode 24 ns cd = 0 3.06 s cd = 7 from sleep mode 1.58 ms from stop mode 1.7 ms programmable logic array (pla) pin propagation delay 12 ns from input pin to output pin element propagation delay 2.5 ns power requirements 15 , 16 power supply voltage range av dd to agnd and iov dd to iognd 3.0 3.6 v analog power supply currents av dd current 200 a adc in idle mode
ADUC7121 rev. 0 | page 9 of 96 parameter min typ max unit test conditions/comments digital power supply current iov dd current in normal mode code executing from flash/ee 7 ma cd = 7 11 ma cd = 3 30 40 ma cd = 0 (41.78 mhz clock) iov dd current in pause mode 4 25 ma cd = 0 (41.78 mhz clock) iov dd current in sleep mode 4 100 a t a = 25c additional power supply currents adc 2.7 ma @1 msps idac 21 ma all current dacs (idacs) on dac 250 a per vdac esd tests 2.5 v reference, t a = 25c hbm passed up to 4 kv ficdm passed up to 0.5 kv 1 all adc channel specifications are guaranteed d uring normal microconvert er core operation. 2 apply to all adc input channels. 3 measured using the factory set default values in the adc offset register (adcof) and gain coefficient register (adcgn). 4 not production tested but supported by design and/or characterization data on production release. 5 measured using the factory set default values in adcof and adcgn with an external ad845 op amp as an input buffer stage as sh own in figure 23. based on external adc system components, the user may need to execute a system calibrat ion to remove external endpoint errors and achieve these speci fications (see the adc section). 6 the input signal can be centered on any dc common-mode voltage (v cm ) provided that this value is within the adc voltage input range specified. 7 v ref calibration and trimming are performed under the following co nditions: the core is operating in normal mode cd = 0, the adc is on, the current dacs are on, and all vdacs are on. v ref accuracy may vary under o ther operating conditions. 8 the pvdd_idac0 pad voltage must be at le ast 300 mv greater than the idac 0 pad voltage. thes e voltages are measured via the pvd d0 and idac0 channels of the adc. this allows the idac0 pin to be pulled up to 1.7 v prov ided that this 300 mv differential voltage is maintained between th e pads. this may require the pvdd_idac0 being supplied with a voltage greater than 2.0 v. the 2.1 v max imum pvdd_idacx rating mu st not be exceeded. 9 dac linearity is calcul ated using a reduced co de range of 100 to 3995. 10 dac gain error is calculated using a reduced code range of 100 to internal 2.5 v v ref . 11 die temperature. 12 endurance is qualified as per jedec standard 22 method a117 and measured at ?40c, +25c, +85c, and +125c. 13 retention lifetime equivalent at junction temperature (t j ) = 85c as per jedec standard 22 method a117. retention lifetime derates with junction temperature. 14 test carried out with a maximum of ei ght i/os set to a low output level. 15 power supply current consumption is measured in normal, pause, and sleep modes under the followin g conditions: no rmal mode usi ng a 3.6 v supply, pause mode using a 3.6 v supply, and sleep mode using 3.6 v supply. 16 iov dd power supply current increases typically by 2 ma during a flash/ee erase cycle.
ADUC7121 rev. 0 | page 10 of 96 timing specifications table 2. i 2 c timing in fast mode (400 khz) slave master parameter description min max typ unit t l scl low pulse width 200 1360 ns t h scl high pulse width 100 1140 ns t shd start condition hold time 300 251,350 ns t dsu data setup time 100 740 ns t dhd data hold time 0 400 ns t rsu setup time for repeated start 100 12.51350 ns t psu stop condition setup time 100 400 ns t buf bus-free time between a stop conditio n and a start condition 1.3 s t r rise time for both scl and sda 300 200 ns t f fall time for both scl and sda 300 ns t sup pulse width of spike suppressed 50 ns table 3. i 2 c timing in standa rd mode (100 khz) slave parameter description min max unit t l sclx low pulse width 4.7 s t h sclx high pulse width 4.0 ns t shd start condition hold time 4.0 s t dsu data setup time 250 ns t dhd data hold time 0 3.45 s t rsu setup time for repeated start 4.7 s t psu stop condition setup time 4.0 s t buf bus-free time between a stop condit ion and a start condition 4.7 s t r rise time for both sclx and sdax 1 s t f fall time for both sclx and sdax 300 ns 09492-002 sdax t buf msb lsb ack msb 1 9 8 2to 7 1 sclx ps stop condition start condition s(r) repeated start t sup t r t f t f t r t h t l t sup t dsu t dhd t rsu t dhd t dsu t shd t psu figure 2. i 2 c-compatible in terface timing
ADUC7121 rev. 0 | page 11 of 96 table 4 spi master mode ti ming (phase mode = 1) parameter description min typ max unit t sl spiclk low pulse width (spidiv + 1) t uclk ns t sh spiclk high pulse width (spidiv + 1) t uclk ns t dav data output valid after spiclk edge 25 ns t dsu data input setup time before spiclk edge 1 1 t uclk ns t dhd data input hold time after spiclk edge 2 t uclk ns t df data output fall time 5 12.5 ns t dr data output rise time 5 12.5 ns t sr spiclk rise time 5 12.5 ns t sf spiclk fall time 5 12.5 ns 1 t uclk = 23.9 ns. it corresponds to the 41.78 mhz internal clock from the pll before the clock divider. 0 9492-003 spiclk (polarity = 0) spiclk (polarity = 1) mosi msb bit 6 to bit 1 lsb miso msb in bit 6 to bit 1 lsb in t sh t sl t sr t sf t dr t df t dav t dsu t dhd figure 3. spi master mode timing (phase mode = 1)
ADUC7121 rev. 0 | page 12 of 96 table 5. spi master mode ti ming (phase mode = 0) parameter description min typ max unit t sl spiclk low pulse width (spidiv + 1) t uclk ns t sh spiclk high pulse width (spidiv + 1) t uclk ns t dav data output valid after spiclk edge 25 ns t dosu data output setup before spiclk edge 75 ns t dsu data input setup time before spiclk edge 1 1 t uclk ns t dhd data input hold time after spiclk edge 2 t uclk ns t df data output fall time 5 12.5 ns t dr data output rise time 5 12.5 ns t sr spiclk rise time 5 12.5 ns t sf spiclk fall time 5 12.5 ns 1 t uclk = 23.9 ns. it corresponds to the 41.78 mhz internal clock from the pll before the clock divider. spiclk (polarity = 0) spiclk (polarity = 1) t sh t sl t sr t sf mosi msb bit 6 to bit 1 lsb miso msb in bit 6 to bit 1 lsb in t dr t df t dav t dosu t dsu t dhd 09492-004 figure 4. spi master mode timing (phase mode = 0)
ADUC7121 rev. 0 | page 13 of 96 table 6. spi slave mode timing (phase mode = 1) parameter description min typ max unit t cs cs to the spiclk edge 1 200 ns t sl spiclk low pulse width 2 (spidiv + 1) t uclk ns t sh spiclk high pulse width 2 (spidiv + 1) t uclk ns t dav data output valid after spiclk edge 25 ns t dsu data input setup time before spiclk edge 1 t uclk ns t dhd data input hold time after spiclk edge 2 t uclk ns t df data output fall time 5 12.5 ns t dr data output rise time 5 12.5 ns t sr spiclk rise time 5 12.5 ns t sf spiclk fall time 5 12.5 ns t sfs cs high after spiclk edge 0 ns 1 cs is the cs (spi slave select input) function of the multifunction pin f3. 2 t uclk = 23.9 ns. it corresponds to the 41.78 mhz internal clock from the pll before the clock divider. 09492-005 spiclk (polarity = 0) cs spiclk (polarity = 1) t sh t sl t sr t sf t sfs miso msb bit 6 to bit 1 lsb mosi msb in bit 6 to bit 1 lsb in t dhd t dsu t dav t dr t df t cs figure 5. spi slave mode timing (phase mode = 1)
ADUC7121 rev. 0 | page 14 of 96 table 7. spi slave mode timing (phase mode = 0) parameter description min typ max unit t cs cs to spiclk edge 1 200 ns t sl spiclk low pulse width 2 (spidiv + 1) t uclk ns t sh spiclk high pulse width 2 (spidiv + 1) t uclk ns t dav data output valid after spiclk edge 25 ns t dsu data input setup time before spiclk edge 2 1 t uclk ns t dhd data input hold time after spiclk edge 2 2 t uclk ns t df data output fall time 5 12.5 ns t dr data output rise time 5 12.5 ns t sr spiclk rise time 5 12.5 ns t sf spiclk fall time 5 12.5 ns t docs data output valid after cs edge 25 ns t sfs cs high after spiclk edge 0 ns 1 cs is the cs (spi slave select input) function of the multifunction pin f3. 2 t uclk = 23.9 ns. it corresponds to the 41.78 mhz internal clock from the pll before the clock divider. spiclk (polarity = 0) cs spiclk (polarity = 1) t sh t sl t sr t sf t sfs miso mosi msb in bit 6 to bit 1 lsb in t dhd t dsu msb bit 6 to bit 1 lsb t docs t dav t dr t df t cs 09492-006 figure 6. spi slave mode timing (phase mode = 0)
ADUC7121 rev. 0 | page 15 of 96 absolute maximum ratings agnd = 0 v, t a = 25c, unless otherwise noted. table 8. stresses above those listed under absolute maximum ratings may cause permanent damage to the device. this is a stress rating only; functional operation of the device at these or any other conditions above those indicated in the operational section of this specification is not implied. exposure to absolute maximum rating conditions for extended periods may affect device reliability. only one absolute maximum rating can be applied at any one time. esd caution parameter rating av dd to iov dd ?0.3 v to +0.3 v agnd to dgnd ?0.3 v to +0.3 v iov dd to iognd, av dd to agnd ?0.3 v to +6 v digital input voltage to iognd ?0.3 v to +5.3 v digital output voltage to iognd ?0.3 v to iov dd + 0.3 v v ref _2.5 and v ref _1.2 to agnd ?0.3 v to av dd + 0.3 v analog inputs to agnd ?0.3 v to av dd + 0.3 v analog outputs to agnd ?0.3 v to av dd + 0.3 v operating temperature range, industrial ?10c to +95c storage temperature range ?65c to +150c junction temperature 150c ja thermal impedance 108-ball csp_bga 40c/w peak solder reflow temperature snpb assemblies (10 sec to 30 sec) 240c rohs-compliant assemblies (20 sec to 40 sec) 260c
ADUC7121 rev. 0 | page 16 of 96 pin configuration and fu nction descriptions 123456789101112 123456789101112 a b c d e f g h j k l m a b c d e f g h j k l m ADUC7121 top view 09492-007 figure 7. pin configuration table 9. pin function descriptions pin no. mnemonic type 1 description c12 rst i reset input (active low). d11 p0.0/scl0/plai[5] i/o general-purpose input and output port 0.0 (p0.0). i 2 c interface serial clock for i 2 c0 (scl0). programmable logic array for input element 5 (plai[5]). e11 p0.1/sda0/plai[4] i/o general-purpose input and output port 0.1 (p0.1). i 2 c interface serial data for i 2 c0 (sda0). programmable logic array for input element 4 (plai[4]). c3 p0.2/spiclk/adc busy /plao[13] i/o general-purpose input and output port 0.2 (p0.2). spi clock (spiclk). status of the adc (adc busy ). programmable logic array for output element 13 (plao[13]). d3 p0.3/miso/plao[12]/sync i/o general-purpose input and output port 0.3 (p0.3). spi master in slave out (miso). programmable logic array for output element 12 (plao[12]). synchronous reset (sync). input to reset synchronously the pwm counters using an external source. e3 p0.4/mosi/plai[11]/trip i/o general-pu rpose input and output port 0.4 (p0.4). spi master out slave in (mosi). programmable logic array for input element 11 (plai[11]). pwm trip interrupt (trip). the trip function of pin e3 is the input that allows the pwm trip interrupt to be triggered. f3 p0.5/ cs /plai[10]/adc convst i/o general-purpose input and output port 0.5 (p0.5). spi slave select input ( cs ). programmable logic array for input element 10 (plai[10]). adc conversions (adc convst ). the adc convst function of pin f3 initiates the adc conversions using the pla or the timer output. g3 p0.6/ mrst /plai[2] i/o general-purpose input and output port 0.6 (p0.6). power on reset output ( mrst ). programmable logic array for input element 2 (plai[2]). g10 p0.7/ trst /plai[3] i/o general-purpose input and output port 0.7 (p0.7). jtag test port input, test reset ( trst ). debug and download access. programmable logic array for input element 3 (plai[3]).
ADUC7121 rev. 0 | page 17 of 96 pin no. mnemonic type 1 description c2 p1.0/sin/scl1/plai[7] i/o general-purpose input and output port 1.0 (p1.0). serial input, receive data, uart (sin). i 2 c interface serial clock for i 2 c1 (scl1). programmable logic array for input element 7 (plai[7]). d2 p1.1/sout/sda1/plai[6] i/o general-purpose input and output port 1.1 (p1.1). serial output, transmit data, uart (sout). i 2 c interface serial data for i 2 c1 (sda1). programmable logic array for input element 6 (plai[6]). c10 p1.2/tdi/plao[15] di general-purpose input and output port 1.2 (p1.2). jtag test port input, test data in (tdi). the tdi function of pin c10 is for debug and download access. programmable logic array for output element 15 (plao[15]). d10 p1.3/tdo/plao[14] do general-purpose input and output port 1.3 (p1.3). jtag test port output, test data out (tdo). the tdo function of pin d10 is for debug and download access. programmable logic array for output element 14 (plao[14]). h3 p1.4/pwm1/eclk/xclk/plai[8] i/o general-purpose input and output port 1.4 (p1.4). pulse-width modulator 1 output (pwm1). base system clock output (eclk). base system clock input (xclk). programmable logic array for input element 8 (plai[8]). j3 p1.5/pwm2/plai[9] i/o general-purpose input and output port 1.5 (p1.5). pulse-width modulator 2 output (pwm2). programmable logic array for input element 9 (plai[9]). b3 p1.6/plao[5] i/o general-purpose input and output port 1.6 (p1.6). programmable logic array for output element 5 (plao[5]). b2 p1.7/plao[4] i/o general-purpose input and output port 1.7 (p1.7). programmable logic array for output element 4 (plao[4]). f11 p2.0/irq0/plai[13] i/o general-purpose input and output port 2.0 (p2.0)/external interrupt request 0, active high. programmable logic array for input element 13 (plai[13]). g11 p2.1/irq1/plai[12] i/o general-purpose input and output port 2.1 (p2.1) external interrupt request 1, active high (irq1). programmable logic array for input element 12 (plai[12]). h11 p2.2/plai[1] i/o general-purpose input and output port 2.2 (p2.2). programmable logic array for input element 1 (plai[1]). j11 p2.3/irq2/plai[14] i/o general-purpose input and output port 2.3 (p2.3). external interrupt request 2, active high (irq2). programmable logic array for input element 14 (plai[14]). h10 p2.4/pwm5/plao[7] i/o general-purpose input and output port 2.4 (p2.4). pulse-width modulator 5 output (pwm5). programmable logic array for output element 7 (plao[7]). j10 p2.5/pwm6/plao[6] i/o general-purpose input and output port 2.5 (p2.5). pulse-width modulator 6 output (pwm6). programmable logic array for output element 6 (plao[6]). c1 p2.6/irq3/plai[15] i/o general-purpose input and output port 2.6 (p2.6). external interrupt request 3, active high (irq3). programmable logic array for input element 15 (plai[15]). c9 p2.7/plai[0] i/o general-purpose input and output port 2.7 (p2.7). c4 p3.0/plao[0] i/o general-purpose input and output port 3.0 (p3.0). programmable logic array for output element 0 (plao[0]). c11 p3.1/plao[1] i/o general-purpose input and output port 3.1 (p3.1). programmable logic array for output element 1 (plao[1]).
ADUC7121 rev. 0 | page 18 of 96 pin no. mnemonic type 1 description d1 p3.2/irq4/pwm3/plao[2] i/o general-pu rpose input and output port 3.2 (p3.2). external interrupt request 4, active high (irq4). pulse-width modulator 3 output (pwm3). programmable logic array for output element 2 (plao[2]). e1 p3.3/irq5/pwm4/plao[3] i/o general-pu rpose input and output port 3.3 (p3.3). external interrupt request 5, active high (irq5). pulse-width modulator 4 output (pwm4). programmable logic array for output element 3 (plao[3]). e2 p3.4/plao[8] i/o general-purpose input and output port 3.4 (p3.4). programmable logic array for output element 8 (plao[8]). f2 p3.5/plao[9] i/o general-purpose input and output port 3.5 (p3.5). programmable logic array for output element 9 (plao[9]). d12 p3.6/plao[10] i/o general-purpose input and output port 3.6 (p3.6). programmable logic array for output element 10 (plao[10]). e12 p3.7/ bm /plao[11] i/o general-purpose input and output port 3.7 (p3.7). programmable logic array for output element 11 (plao[11]). l8 v ref _2.5 ai/o 2.5 v reference output and external 2.5 v reference input. l5 v ref _1.2 ai/o 1.2 v reference output and external 1.2 v re ference input. cannot be used to source current externally. b8 i ref ai/o generates reference current for idacs. set by the external resistor, r ext . k6 buf_vref1 ao buffered 2.5 v. the maximum load for buf_vref1 is 1.2 ma. k7 buf_vref2 ao buffered 2.5 v. the maximum load for buf_vref2 is 1.2 ma. l6 padc0p ai pga channel 0+. m5 padc0n ai pga channel 0?. l7 padc1p ai pga channel 1+. m8 padc1n ai pga channel 1?. k5 nc nc no connect. do not connect to this pin. k4 nc nc no connect. do not connect to this pin. m4 nc nc no connect. do not connect to this pin. l4 nc nc no connect. do not connect to this pin. k3 adc4 ai single-ended or differential analog input 4. m3 adc5 ai single-ended or differential analog input 5. m10 adc6 ai single-ended or differential analog input 6. m9 adc7 ai single-ended or differential analog input 7. l9 adc8 ai single-ended or differential analog input 8. k9 adc9 ai single-ended or differential analog input 9. k8 adc10/aincm ai single-ended or differential analog input 10 (adc10). common mode (aincm). the common-mode fu nction of this pin is for pseudo differential input. k1 dac0 ao 12-bit dac0 output. k2 dac1 ao 12-bit dac1 output. j2 nc nc no connect. do not connect to this pin. l2 nc nc no connect. do not connect to this pin. m2 nc nc no connect. do not connect to this pin. l3 nc nc no connect. do not connect to this pin. m11 dac2 ao 12-bit dac2 output. l11 nc nc no connect. do not connect to this pin. l10 nc nc no connect. do not connect to this pin. k10 nc nc no connect. do not connect to this pin. k11 nc nc no connect. do not connect to this pin. k12 dac3 ao 12-bit dac3 output. b5 idac4 ao idac4 output. the maximum output for this pin is 20 ma. c6 pvdd_idac4 s 2.0 v power for idac4.
ADUC7121 rev. 0 | page 19 of 96 pin no. mnemonic type 1 description a6 c damp _idac4 ai damping capacitor pin for idac4. a8 idac3 ao idac3 output. the maximum output for this pin is 45 ma. a7 pvdd_idac3 s 2.0 v power for idac3. c8 c damp _idac3 ai damping capacitor pin for idac3. a5 idac2 ao idac2 output. the maximum output for this pin is 80 ma. c5 pvdd_idac2 s 2.0 v power for the idac2. b4 c damp _idac2 ai damping capacitor for idac2. a4 idac1 ao idac1 output. the maximum output is 200 ma. a1 idac1 ao idac1 output. the maximum output is 200 ma. a3 pvdd_idac1 s power for idac1. a2 pvdd_idac1 s power for idac1. b1 c damp _idac1 ai damping capacitor for idac1. a12 idac0 ao idac0 output. the maximum output is 250 ma. a9 idac0 ao idac0 output. the maximum output is 250 ma. a11 pvdd_idac0 s power for idac0. a10 pvdd_idac0 s power for idac0. b12 c damp _idac0 ai damping capacitor pin for idac0. b11 idac_tst ai/o idac test purposes. b10 pgnd s power ground. b9 pgnd s power ground. m1 agnd s analog ground. m6 agnd s analog ground. l1 avdd s analog supply (3.3 v). m7 avdd s analog supply (3.3 v). m12 agnd s analog ground. b6 agnd s analog ground. l12 avdd s analog supply (3.3 v). c7 avdd s analog supply (3.3 v). b7 avdd_idac s output of 2.5 v ldo regulator for internal idacs. a 470 nf capacitor to agnd must be connected to this pin. g1 dvdd s output of 2.6 v on-chip ldo regulator. a 470 nf capacitor to dgnd must be connected to this pin. g12 dvdd s output of 2.6 v on-chip ldo regulator. a 470 nf capacitor to dgnd must be connected to this pin. f1 dgnd s digital ground. f12 dgnd s digital ground. h1 iovdd s 3.3 v gpio supply. j1 iognd s 3.3 v gpio ground. h12 iovdd s 3.3 v gpio supply. j12 iognd s 3.3 v gpio ground. g2 xtalo do crystal oscillator inverter output. if an exte rnal crystal is not being used, this pin can remain unconnected. h2 xtali di crystal oscillator inverter input and internal clock generator circuits input. if an external crystal is not being used, conne ct this pin to the dgnd system ground. f10 tck di jtag test port input, test clock. debug and download access. e10 tms di jtag test port input, test mode select. debug and download access. 1 a is analog, d is digital, i is input, o is output, and s is supply, nc is no connect.
ADUC7121 rev. 0 | page 20 of 96 terminology adc specifications integral nonlinearity integral nonlinearity (inl) is the maximum deviation of any code from a straight line passing through the endpoints of the adc transfer function. the endpoints of the transfer function are zero scale, a point lsb below the first code transition, and full scale, a point lsb above the last code transition. differential nonlinearity differential nonlinearity (dnl) is the difference between the measured and the ideal 1 lsb change between any two adacent codes in the adc. offset error offset error is the deviation of the first code transition (0000 . . . 000) to (0000 . . . 001) from the ideal, that is, + lsb. gain error gain error is the deviation of the last code transition from the ideal ain voltage (full scale 1.5 lsb) after the offset error has been adusted out. signal to (noise + distortion) ratio signal to (noise + distortion) ratio, or sinad, is the measured ratio of signal to (noise + distortion) at the output of the adc. the signal is the rms amplitude of the fundamental. noise is the rms sum of all nonfundamental signals up to half the sampling frequency (f s /2), excluding dc. the ratio is dependent on the number of quantization levels in the digitization process: the more levels there are, the smaller the quantization noise becomes. the theoretical sinad ratio for an ideal n-bit converter with a sine wave input is given by signal to noise distortion n 7 db thus for a it conerter this is 7 db total harmonic distortion total harmonic distortion (thd) is the ratio of the rms sum of the harmonics to the fundamental. dac specifications relative accuracy otherwise known as endpoint linearity, relative accuracy is a measure of the maximum deviation from a straight line passing through the endpoints of the dac transfer function. it is measured after adusting for zero error and full-scale error. voltage output settling time this is the amount of time it takes the output to settle to within a one lsb level for a full-scale input change.
ADUC7121 rev. 0 | page 21 of 96 overview of the arm7tdmi core the arm7? core is a 32-bit reduced instruction set computer (risc). it uses a single 32-bit bus for instruction and data. the length of the data can be 8 bits, 16 bits, or 32 bits. the length of the instruction word is 32 bits. the arm7tdmi? is an arm7 core with four additional features, as follows: ? t support for the thumb (16-bit) instruction set ? d support for debug ? m support for long multiplications ? i includes the embeddedice? module to support embedded system debugging thumb mode (t) an arm? instruction is 32 bits long. the arm7tdmi processor supports a second instruction set that has been compressed into 16 bits, called the thumb? instruction set. faster execution from 16-bit memory and greater code density can usually be achieved by using the thumb instruction set instead of the arm instruc- tion set, which makes the arm7tdmi core particularly suitable for embedded applications. however, the thumb mode has two limitations, as follows: ? thumb code typically requires more instructions for the same job. as a result, arm code is usually best for maximizing the performance of time-critical code. ? the thumb instruction set does not include some of the instructions needed for exception handling, which automatically switches the core to arm code for exception handling. see the arm7tdmi user guide for details on the core architecture, the programming model, and both the arm and arm thumb instruction sets. long multiply (m) the arm7tdmi instruction set includes four extra instruc- tions that perform 32-bit by 32-bit multiplication with a 64-bit result, and 32-bit by 32-bit multiplication accumulation (mac) with a 64-bit result. these results are achieved in fewer cycles than required on a standard arm7 core. embeddedice (i) embeddedice provides integrated on-chip support for the core. the embeddedice module contains the breakpoint and watch- point registers that allow code to be halted for debugging purposes. these registers are controlled through the jtag test port. when a breakpoint or watchpoint is encountered, the processor halts and enters debug state. when in a debug state, the pro- cessor registers can be inspected, as well as the flash/ee, sram, and memory mapped registers. exceptions arm supports five types of exceptions and a privileged processing mode for each type. the five types of exceptions are ? normal interrupt or irq. this is provided to service general-purpose interrupt handling of internal and external events. ? fast interrupt or fiq. this is provided to service data transfers or communication channels with low latency. fiq has priority over irq. ? memory abort. ? attempted execution of an undefined instruction. ? software interrupt instruction (swi). this can be used to make a call to an operating system. typically, the programmer defines interrupt as irq, but for higher priority interrupt, that is, faster response time, the programmer can define interrupt as fiq.
ADUC7121 rev. 0 | page 22 of 96 arm registers arm7tdmi has a total of 37 registers: 31 general-purpose registers and 6 status registers. each operating mode has dedicated banked registers. when writing user level programs, 15 general-purpose 32-bit registers (r0 to r14), the program counter (r15), and the cur- rent program status register (cpsr) are usable. the remaining registers are used for system level programming and exception handling only. when an exception occurs, some of the standard registers are replaced with registers specific to the exception mode. all excep- tion modes have replacement banked registers for the stack pointer (r13) and the link register (r14) as represented in figure 8 . the fast interrupt mode has more registers (r8 to r12) for fast interrupt processing. this means that the interrupt processing can begin without the need to save or restore these registers, thus saving critical time in the interrupt handling process. 09492-008 usable in user mode system modes only spsr_und spsr_irq spsr_abt spsr_svc r8_fiq r9_fiq r10_fiq r11_fiq r12_fiq r13_fiq r14_fiq r13_und r14_und r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 (pc) r13_irq r14_irq r13_abt r14_abt r13_svc r14_svc spsr_fiq cpsr user mode fiq mode svc mode abort mode irq mode undefined mode figure 8. register organization more information relative to the programmers model and the arm7tdmi core architecture can be found in the following materials from arm, ltd.: ? arm ddi 0029g, arm7tdmi technical reference manual ? arm ddi 0100, arm architecture reference manual interrupt latency the worst-case latency for a fast interrupt request (fiq) consists of the following: ? the longest time the request can take to pass through the synchronizer. ? the time for the longest instruction to complete (the longest instruction is an ldm) that loads all the registers including the pc. ? the time for the data abort entry. ? the time for fiq entry. at the end of this time, the arm7tdmi executes the instruc- tion at 0x1c (fiq interrupt vector address). the maximum total time is 50 processor cycles, which is just under 1.2 s in a system using a continuous 41.78 mhz processor clock. the maximum interrupt request (irq) latency calculation is similar, but must allow for the fact that fiq has higher priority and may delay entry into the irq handling routine for an arbitrary length of time. this time can be reduced to 42 cycles if the ldm command is not used. some compilers have an option to compile without using this command. another option is to run the part in thumb mode wherein the time is reduced to 22 cycles. the minimum latency for fiq or irq interrupts is a total of five cycles, which consist of the shortest time the request can take through the synchronizer plus the time to enter the exception mode. note that the arm7tdmi always runs in arm (32-bit) mode when in privileged modes, for example, when executing interrupt service routines.
ADUC7121 rev. 0 | page 23 of 96 memory organization flash/ee memory the ADUC7121 incorporates three separate blocks of memory: 8 kb of sram and two 64 kb of on-chip flash/ee memory. there are 126 kb of on-chip flash/ee memory available to the user, and the remaining 2 kb are reserved for the factory- configured boot page. these two blocks are mapped as shown in figure 9 . the 128 kb of flash/ee are organized as two banks of 32k 16 bits. in the first block, 31k 16 bits is user space and 1k 16 bits is reserved for the factory configured boot page. the page size of this flash/ee memory is 512 bytes. the second 64 kb block is organized in a similar manner. it is arranged in 32k 16 bits, all of which is available as user space. note that by default, after a rese t, the flash/ee memory is mirrored at address 0x00000000. it is possible to remap the sram at address 0x00000000 by clearing bit 0 of the remap mmr. this remap function is described in more detail in the flash/ee memory section. the 126 kb of flash/ee are available to the user as code and nonvolatile data memory. there is no distinction between data and program because arm code shares the same space. the real width of the flash/ee memory is 16 bits, meaning that in arm mode (32-bit instruction), two accesses to the flash/ee are neces- sary for each instruction fetch. therefore, it is recommended that thumb mode be used when executing from flash/ee memory for optimum access speed. the maximum access speed for the flash/ee memory is 41.78 mhz in thumb mode and 20.89 mhz in full arm mode (see the execution time from sram and flash/ee section). reserved 0x00080000 flash/ee reserved 0x00041fff 0x00040000 sram 0xffff0000 0xffffffff mmrs 0x0001ffff 0x00000000 0x0009f800 reserved remappable memory space (flash/ee or sram) 09492-009 sram the 8 kb of sram are available to the user, organized as 2k 32 bits, that is, 2k words. arm code can run directly from sram at 41.78 mhz, given that the sram array is configured as a 32-bit wide memory array (see the execution time from sram and flash/ee section). figure 9. physical memory map memory mapped registers memory access the memory mapped register (mmr) space is mapped into the upper two pages of the memory array and accessed by indirect addressing through the arm7 banked registers. the arm7 core sees memory as a linear array of 2 32 byte locations where the different blocks of memory are mapped as outlined in figure 9 . the mmr space provides an interface between the cpu and all on-chip peripherals. all registers, except the core registers, reside in the mmr area. all shaded locations shown in figure 11 are unoccupied or reserved locations and should not be accessed by user software. table 10 through table 27 provide the complete mmr memory maps. the ADUC7121 memory organization is configured in little endian format: the least significant byte is located in the lowest byte address and the most significant byte is located in the highest byte address. bit 31 byte 2 a 6 2 . . . byte 3 b 7 3 . . . byte 1 9 5 1 . . . byte 0 8 4 0 . . . bit 0 32 bits 0xffffffff 0x00000004 0x00000000 09492-010 the access time reading or writing an mmr depends on the advanced microcontroller bus architecture (amba) bus used to access the peripheral. the processor has two amba buses: advanced high performance bus (ahb) used for system modules and advanced peripheral bus (apb) used for a lower performance peripheral. access to the ahb is one cycle, and access to the apb is two cycles. all peripherals on the ADUC7121 are on the apb except the flash/ee memory and the gpios. figure 10. little endian format
ADUC7121 rev. 0 | page 24 of 96 pla 0xffff0a00 0xffff0950 0xffff0900 0xffff08d0 0xffff0880 0xffff0a14 0xffff0d00 0xffff0b00 0xffff0b54 uart0 0xffff082c 0xffff0800 i 2 c0 i 2 c1 spi 0xffff0d78 0xffff0e00 0xffff0e28 flash control interface 0 flash control interface 1 gpio 0xffff0e80 0xffff0ea8 0xffff0f80 0xffff0fbc 0xffffffff pwm interrupt controller remap and system control idac dac adc bandgap reference power supply monitor timer 0 general purpose timer 4 watchdog timer general purpose timer wakeup timer 0xffff0000 0xffff013c 0xffff0320 0xffff0318 0xffff0300 0xffff0240 0xffff0200 0xffff0580 0xffff0746 0xffff0700 0xffff05df 0xffff0500 0xffff0524 0xffff04a8 0xffff0480 0xffff0334 0xffff0448 0xffff0440 0xffff0418 0xffff0400 0xffff0340 0xffff0350 0xffff0360 0xffff0370 pll and oscillator control 0xffff0380 0xffff0394 0 9492-011 figure 11. memory mapped registers complete mmr listing note that the access type column corresponds to the access time reading or writing an mmr, where r is read, w is write, and r/w is read/write. it depends on the amba bus that is used to access the peripheral. the processor has two amba buses: the advanced high performance bus (ahb ) used for system modules and the advanced peripheral bus (apb) used for lower performance peripherals. table 10. irq base address = 0xffff0000 address name byte access type cycle 0x0000 irqsta 4 r 1 0x0004 irqsig 4 r 1 0x0008 irqen 4 r/w 1 0x000c irqclr 4 r/w 1 0x0010 swicfg 4 w 1 0x0014 irqbase 4 r/w 1 0x001c irqvec 4 r/w 1 0x0020 irqp0 4 r/w 1 0x0024 irqp1 4 r/w 1 0x0028 irqp2 4 r/w 1 0x002c irqp3 4 r/w 1 0x0030 irqconn 1 r/w 1 0x0034 irqcone 4 r/w 1 0x0038 irqclre 1 w 1 0x003c irqstan 1 r/w 1 0x0100 fiqsta 4 r 1 0x0104 fiqsig 4 r 1 0x0108 fiqen 4 r/w 1 0x010c fiqclr 4 w 1 0x011c fiqvec 4 r 1 0x013c fiqstan 1 r/w 1 table 11. system control base address = 0xffff0200 address name byte access type cycle 0x0220 remap 1 r/w 1 0x0230 rststa 1 r 1 0x0234 rstclr 1 w 1 table 12. timer base address = 0xffff0300 address name byte access type cycle 0x0300 t0ld 2 r/w 2 0x0304 t0val0 2 r 2 0x0308 t0val1 4 r 2 0x030c t0con 4 r/w 2 0x0310 t0clri 1 w 2 0x0314 t0cap 2 r 2 0x0320 t1ld 4 r/w 2 0x0324 t1val 4 r 2 0x0328 t1con 4 r/w 2 0x032c t1clri 1 w 2 0x0330 t1cap 4 r 2 0x0340 t2ld 4 r/w 2 0x0344 t2val 4 r 2 0x0348 t2con 4 r/w 2 0x034c t2clri 1 w 2 0x0360 t3ld 2 r/w 2 0x0364 t3val 2 r 2 0x0368 t3con 2 r/w 2 0x036c t3clri 1 w 2 0x0380 t4ld 4 r/w 2 0x0384 t4val 4 r 2 0x0388 t4con 4 r/w 2 0x038c t4clri 1 w 2 0x0390 t4cap 4 r 2
ADUC7121 rev. 0 | page 25 of 96 table 13. pll base address = 0xffff0400 address name byte access type cycle 0x0404 powkey1 2 w 2 0x0408 powcon 1 r/w 2 0x040c powkey2 2 w 2 0x0410 pllkey1 2 w 2 0x0414 pllcon 1 r/w 2 0x0418 pllkey2 2 w 2 table 14. psm base address = 0xffff0440 address name byte access type cycle 0x0440 psmcon 2 r/w 2 table 15. reference base address = 0xffff0480 address name byte access type cycle 0x0480 refcon 1 r/w 2 table 16. adc base address = 0xffff0500 address name byte access type cycle 0x0500 adccon 4 r/w 2 0x0504 adccp 1 r/w 2 0x0508 adccn 1 r/w 2 0x050c adcsta 1 r 2 0x0510 adcdat 4 r 2 0x0514 adcrst 1 w 2 0x0518 adcgn 2 r/w 2 0x051c adcof 2 r/w 2 0x0520 pga_gn 2 r/w 2 table 17. dac base address = 0xffff0580 address name byte access type cycle 0x0580 dac0con 2 r/w 2 0x0584 dac0dat 4 r/w 2 0x0588 dac1con 2 r/w 2 0x058c dac1dat 4 r/w 2 0x05b0 dac2con 2 r/w 2 0x05b4 dac2dat 4 r/w 2 0x05d8 dac3con 2 r/w 2 0x05dc dac3dat 4 r/w 2 table 18. idac base address = 0xffff0700 address name byte access type cycle 0x0700 idac0con 2 r/w 2 0x0704 idac0dat 4 r/w 2 0x0708 idac0bw 1 r/w 2 0x070c idac1con 2 r/w 2 0x0710 idac1dat 4 r/w 2 0x0714 idac1bw 1 r/w 2 0x0718 idac2con 2 r/w 2 0x071c idac2dat 4 r/w 2 0x0720 idac2bw 1 r/w 2 0x0724 idac3con 2 r/w 2 0x0728 idac3dat 4 r/w 2 0x072c idac3bw 1 r/w 2 0x0730 idac4con 2 r/w 2 address name byte access type cycle 0x0734 idac4dat 4 r/w 2 0x0738 idac4bw 1 r/w 2 0x073c tsdcon 1 r/w 2 0x0740 idacsta 1 r/w 2 0x0744 idac0pulldown 1 r/w 2 table 19. uart0 base address = 0xffff0800 address name byte access type cycle 0x0800 comtx 1 w 2 comrx 1 r 2 comdiv0 1 r/w 2 0x0804 comien0 1 r/w 2 comdiv1 1 r/w 2 0x0808 comiid0 1 r 2 0x080c comcon0 1 r/w 2 0x0810 comcon1 1 r/w 2 0x0814 comsta0 1 r 2 0x082c comdiv2 2 r/w 2 table 20. i 2 c0 base address = 0xffff0880 address name byte access type cycle 0x0880 i2c0mctl 2 r/w 2 0x0884 i2c0msta 2 r 2 0x0888 i2c0mrx 1 r 2 0x088c i2c0mtx 2 w 2 0x0890 i2c0mcnt0 2 r/w 2 0x0894 i2c0mcnt1 1 r 2 0x0898 i2c0adr0 1 r/w 2 0x089c i2c0adr1 1 r/w 2 0x08a0 i2c0sbyte 1 r/w 2 0x08a4 i2c0div 2 r/w 2 0x08a8 i2c0sctl 2 r/w 2 0x08ac i2c0ssta 2 r 2 0x08b0 i2c0srx 1 r 2 0x08b4 i2c0stx 1 w 2 0x08b8 i2c0alt 1 r/w 2 0x08bc i2c0id0 1 r/w 2 0x08c0 i2c0id1 1 r/w 2 0x08c4 i2c0id2 1 r/w 2 0x08c8 i2c0id3 1 r/w 2 0x08cc i2c0fsta 1 r/w 2 table 21. i 2 c1 base address = 0xffff0900 address name byte access type cycle 0x0900 i2c1mctl 2 r/w 2 0x0904 i2c1msta 2 r 2 0x0908 i2c1mrx 1 r 2 0x090c i2c1mtx 2 w 2 0x0910 i2c1mcnt0 2 r/w 2 0x0914 i2c1mcnt1 1 r 2 0x0918 i2c1adr0 1 r/w 2 0x091c i2c1adr1 1 r/w 2 0x0920 i2c1sbyte 1 r/w 2
ADUC7121 rev. 0 | page 26 of 96 address name byte access type cycle 0x0924 i2c1div 2 r/w 2 0x0928 i2c1sctl 2 r/w 2 0x092c i2c1ssta 2 r 2 0x0930 i2c1srx 1 r 2 0x0934 i2c1stx 1 w 2 0x0938 i2c1alt 1 r/w 2 0x093c i2c1id0 1 r/w 2 0x0940 i2c1id1 1 r/w 2 0x0944 i2c1id2 1 r/w 2 0x0948 i2c1id3 1 r/w 2 0x094c i2c1fsta 1 r/w 2 table 22. spi base address = 0xffff0a00 address name byte access type cycle 0x0a00 spista 2 r 2 0x0a04 spirx 1 r 2 0x0a08 spitx 1 w 2 0x0a0c spidiv 1 r/w 2 0x0a10 spicon 2 r/w 2 table 23. pla base address = 0xffff0b00 address name byte access type cycle 0x0b00 plaelm0 2 r/w 2 0x0b04 plaelm1 2 r/w 2 0x0b08 plaelm2 2 r/w 2 0x0b0c plaelm3 2 r/w 2 0x0b10 plaelm4 2 r/w 2 0x0b14 plaelm5 2 r/w 2 0x0b18 plaelm6 2 r/w 2 0x0b1c plaelm7 2 r/w 2 0x0b20 plaelm8 2 r/w 2 0x0b24 plaelm9 2 r/w 2 0x0b28 plaelm10 2 r/w 2 0x0b2c plaelm11 2 r/w 2 0x0b30 plaelm12 2 r/w 2 0x0b34 plaelm13 2 r/w 2 0x0b38 plaelm14 2 r/w 2 0x0b3c plaelm15 2 r/w 2 0x0b40 placlk 1 r/w 2 0x0b44 plairq 2 r/w 2 0x0b48 plaadc 4 r/w 2 0x0b4c pladin 4 r/w 2 0x0b50 plaout 4 r 2 0x0b54 plalck 1 w 2 table 24. gpio base address = 0xffff0d00 address name byte access type cycle 0x0d00 gp0con 4 r/w 1 0x0d04 gp1con 4 r/w 1 0x0d08 gp2con 4 r/w 1 0x0d0c gp3con 4 r/w 1 0x0d20 gp0dat 4 r/w 1 0x0d24 gp0set 1 w 1 address name byte access type cycle 0x0d28 gp0clr 1 w 1 0x0d2c gp0par 4 r/w 1 0x0d30 gp1dat 4 r/w 1 0x0d34 gp1set 1 w 1 0x0d38 gp1clr 1 w 1 0x0d3c gp1par 4 r/w 1 0x0d40 gp2dat 4 r/w 1 0x0d44 gp2set 1 w 1 0x0d48 gp2clr 1 w 1 0x0d4c gp2par 4 r/w 1 0x0d50 gp3dat 4 r/w 1 0x0d54 gp3set 1 w 1 0x0d58 gp3clr 1 w 1 0x0d5c gp3par 4 r/w 1 table 25. flash/ee block 0 base address = 0xffff0e00 address name byte access type cycle 0x0e00 fee0sta 1 r 1 0x0e04 fee0mod 1 r/w 1 0x0e08 fee0con 1 r/w 1 0x0e0c fee0dat 2 r/w 1 0x0e10 fee0adr 2 r/w 1 0x0e18 fee0sgn 3 r 1 0x0e1c fee0pro 4 r/w 1 0x0e20 fee0hid 4 r/w 1 table 26. flash/ee block 1 base address = 0xffff0e80 address name byte access type cycle 0x0e80 fee1sta 1 r 1 0x0e84 fee1mod 1 r/w 1 0x0e88 fee1con 1 r/w 1 0x0e8c fee1dat 2 r/w 1 0x0e90 fee1adr 2 r/w 1 0x0e98 fee1sgn 3 r 1 0x0e9c fee1pro 4 r/w 1 0x0ea0 fee1hid 4 r/w 1 table 27. pwm base address= 0xffff0f80 address name byte access type cycle 0x0f80 pwmcon1 2 r/w 2 0x0f84 pwm1com1 2 r/w 2 0x0f88 pwm1com2 2 r/w 2 0x0f8c pwm1com3 2 r/w 2 0x0f90 pwm1len 2 r/w 2 0x0f94 pwm2com1 2 r/w 2 0x0f98 pwm2com2 2 r/w 2 0x0f9c pwm2com3 2 r/w 2 0x0fa0 pwm2len 2 r/w 2 0x0fa4 pwm3com1 2 r/w 2 0x0fa8 pwm3com2 2 r/w 2 0x0fac pwm3com3 2 r/w 2 0x0fb0 pwm3len 2 r/w 2 0x0fb4 pwmcon2 2 r/w 2 0x0fb8 pwmiclr 2 w 2
ADUC7121 rev. 0 | page 27 of 96 adc circuit overview the analog-to-digital converter (adc) incorporates a fast, multichannel, 12-bit adc. it can operate from a 3.0 v to 3.6 v supply and is capable of providing a throughput of up to 1 msps when the clock source is 41.78 mhz. this block provides the user with a multichannel multiplexer, a differential track-and- hold, an on-chip reference, and an adc. the adc consists of a 12-bit successive approximation converter based around two capacitor dacs. depending on the input signal configuration, the adc can operate in one of the following three modes: ? fully differential mode, for small and balanced signals. ? single-ended mode, for any single-ended signals. ? pseudo differential mode, for any single-ended signals, taking advantage of the common-mode rejection offered by the pseudo differential input. the converter accepts an analog input range of 0 v to v ref when operating in single-ended mode or pseudo differential mode. in fully differential mode, the input signal must be balanced around a common-mode voltage (v cm ) in the range of 0 v to av dd and with a maximum amplitude of 2 v ref (see figure 12 ). av dd v cm v cm v cm 0 2v ref 2v ref 2v ref 0 9492-012 figure 12. examples of balanced signals for fully differential mode a high precision, low drift, and factory calibrated 2.5 v reference is provided on chip. an external reference can also be connected as described in the band gap reference section. single or continuous conversion modes can be initiated in the software. an external adc convst pin, an output generated from the on-chip pla, a timer0, or a timer1 overflow can also be used to generate a repetitive trigger for adc conversions. if the signal has not been deasserted by the time the adc conversion is complete, a second conversion begins automatically. a voltage output from an on-chip band gap reference propor- tional to absolute temperature can also be routed through the front-end adc multiplexer, effectively creating an additional adc channel input. this facilitates an internal temperature sensor channel, measuring die temperature to an accuracy of 3c. the ADUC7121 is modified in a way that differentiates its adc structure from other devices in the aduc702x family. the padc0x and padc1x inputs connect to a pga and allow for a gain from 1 to 5 with 32 steps. the remaining channels can be configured as single ended or differential. a buffer is provided before the adc for measuring internal channels. adc transfer function pseudo differential and single-ended modes for both pseudo differential and single-ended modes, the input range is 0 to v ref . in addition, the output coding is straight binary in both pseudo differential and single-ended modes with 1 lsb = fs /4096, or 2.5 v/4096 = 0.61 mv, or 610 v when v ref = 2.5 v the ideal code transitions occur midway between successive integer lsb values (that is, 1/2 lsb, 3/2 lsbs, 5/2 lsbs, , fs ? 3/2 lsbs). the ideal input/output transfer characteristic is shown in figure 13 . output code voltage input 1111 1111 1111 1111 1111 1110 1111 1111 1101 1111 1111 1100 0000 0000 0011 1lsb0v +fs ? 1lsb 0000 0000 0010 0000 0000 0001 0000 0000 0000 1lsb = fs 4096 09492-013 figure 13. adc transfer function in pseudo differential mode or single-ended mode
ADUC7121 rev. 0 | page 28 of 96 fully differential mode the amplitude of the differential signal is the difference between the signals applied to the v in+ and v in? inputs (that is, v in+ ? v in? ). therefore, the maximum amplitude of the differential signal is ?v ref to +v ref p-p (2 v ref ). this is regardless of the common mode (cm). the common mode is the average of the two signals (v in+ + v in? )/2, and is, therefore, the voltage that the two inputs are centered on, which results in the span of each input being cm v ref /2. this voltage must be set up externally, and its range varies with v ref (see the driving the analog inputs section). the output coding is twos complement in fully differential mode with 1 lsb = 2 v ref /4096 or 2 2.5 v/4096 = 1.22 mv when v ref = 2.5 v the output result is 11 bits, but this is shifted by one bit to the right. this allows the result in adcdat to be declared as a signed integer when writing c code. the designed code transi- tions occur midway between successive integer lsb values (that is, 1/2 lsb, 3/2 lsbs, 5/2 lsbs, , fs ? 3/2 lsbs). the ideal input/ output transfer characteristic is shown in figure 14 . output code voltage input (v in + ? v in ?) 0 1111 1111 1110 0 1111 1111 1100 0 1111 1111 1010 0 0000 0000 0001 0 0000 0000 0000 1 1111 1111 1110 1 0000 0000 0100 1 0000 0000 0010 1 0000 0000 0000 ?v ref + 1lsb +v ref ? 1lsb 0lsb 1lsb = 2 v ref 4096 sign bit 09492-014 figure 14. adc transfer function in differential mode padc0x/padc1x pins the padc0x and padc1x pins are differential input channels to the adc that each have a programmable gain amplifier (pga ) on their front ends. an external precision resistor converts the current to voltage and the pga then amplifies this voltage signal with gain up to 5 by 32 steps. the intention is to compensate the variation of the detector diode responsivity and normalize optical power read by the adc. the external resistor is assumed 0.1% accuracy, 5 ppm. a 1 nf capacitor is shunted with the resistor to suppress wideband noise. select the resistor value such that the full-scale voltage developed on the resistor is less than av dd ? 1.2 v, or typically 1.8 v. the pga is designed to handle 10 mv minimum input. to minimize noise, bypass the adc input buffer. padc0n is driven by a buffer to 0.15 v to keep the pga from saturation when the input current drops to zero. the buffer can be disabled by setting the adccon bit 14 so that the padc0n pin can be connected to the ground plane as well. this is the same for the padc1n pin. the adc needs to be placed in pseudo differential mode and assumes that the negative input is close to ground. all of the controls are independently set through register bits for giving maximum flexibility to the user. typically, users need to take the following steps (using padc0x as an example): 1. select pad c0n and pad c0p as the pga input. 2. select the pga output as a mux input. 3. enable the padc0n pin buffer. 4. disable the adc input buffer. 5. set the proper gain value for the pga. 6. bypass the buffer. 7. set the adc to pseudo differential mode. 8. start the conversion. other input channels ADUC7121 contains seven extra adc input pins. these pins can also be configured as differential input pairs or single-ended inputs, or pseudo differential inputs. the buffer and adc are configured independently from the input channel selection. note that the input range of the adc input buffer is from 0.15 v to av dd ? 0.15 v; if the input signal range exceeds this range, the input buffer must be bypassed. the ADUC7121 provides two pins for each thermistor input. the negative input removes the error of the ground difference. when selecting the thermistor input, always bypass the negative side buffer to ensure that the amplifier is not saturated. configure the adc to work in positive pseudo differential mode. besides these external inputs, the adc can also select internal inputs to monitor three power supplies: iovdd, pvdd_idac0, and pvdd_idac1. the voltage of the five idac outputs can also be monitored by the adc by selecting the required channel in register adccp. these internal signals are single- ended and can select agnd/pgnd/iognd as the negative input of the adc via the adccn register. note that when monitoring idac outputs or pvdd_idac0, pvdd_idac1, or iovdd_mon, the buffer must be enabled to isolate interference from adc sampling. an on-chip diode can also be selected to provide chip temperature monitoring. the adc can also select v ref and agnd as inputs for calibration purposes. pga and input buffer the pga is a one stage, positive gain amplifier that is able to accept input from 0.1 v to av dd ? 1.2 v, and the output swing should be at least 2.5 v. the gain of the pga is from 1 to 5 with 32 linear steps. the pga cannot be bypassed for the padc0x and padc1x channels.
ADUC7121 rev. 0 | page 29 of 96 the input level for pga is limited to a maximum value of avdd ? 1.2 v and minimum value of 0.1 v to ensure that the amplifiers are not saturated. the input buffer is a rail-to-rail buffer. it can accept signals from 0.15 to avdd ? 0.15 v. both the positive and negative input buffers can be bypassed indepen- dently by setting adccon bits[15:14]. typical operation once configured via the adc control and channel selection registers, the adc converts the analog input and provides a 12-bit result in the adc data register. the top four bits are the sign bits, and the 12-bit result is placed from bit 27 to bit 16, as shown in figure 15 . again, note that, in fully differential mode, the result is represented in twos comple- ment format, and when in pseudo differential and single-ended modes, the result is represented in straight binary format. sign bits 12-bit adc result 31 27 16 15 0 09492-015 figure 15. adc result format timing figure 16 provides details of the adc timing. users control the adc clock speed and the number of acquisition clocks in the adccon mmr. by default, the acquisition time is eight clocks and the clock divider is two. the number of additional clocks (such as bit trial or write) is set to 19, giving a sampling rate of 774 ksps. for conversion on the temperature sensor, the adc acquisition time is automatically set to 16 clocks and the adc clock divider is set to 32. when using multiple channels, including the temperature sensor, the timing settings revert back to the user-defined settings after reading the temperature sensor channel. adc clock acq bit trial data adcsta = 0 adcsta = 1 adc interrupt write conv start adc busy adcdat 09492-016 figure 16. adc timing temperature sensor the ADUC7121 provides a voltage output from an on-chip band gap reference proportional to absolute temperature. this voltage output can also be routed through the front-end adc multiplexer (effectively, an additional adc channel input), facilitating an internal temperature sensor channel that measures die temperature. the internal temperature sensor is not designed for use as an absolute ambient temperature calculator. it is intended for use as an approximate indicator of the temperature of the ADUC7121 die. the typical temperature coefficient is ?0.707 mv/c. 09492-017 1250 1000 1050 1100 1150 1200 ?20 0 40 60 80 20 100 adcdat (db) temperature (c) figure 17. adc output vs. temperature adc mmr interface the adc is controlled and configured via a number of mmrs (see table 28 ) that are described in detail in this section. table 28. adc mmrs name description adccon adc control register. adccon allows the programmer to enable the adc peripheral, to select the mode of operation of the adc (either single-ended, pseudo differential, or fully differential mode), and to select the conversion type (see table 29 ). adccp adc positive channel selection register. adccn adc negative channel selection register. adcsta adc status register. adcsta indicates when an adc conversion result is ready. the adcsta register contains only one bit, adcready (bit 0), representing the status of the adc. this bit is set at the end of an adc conversion generating an adc interrupt. it is cleared automatically by reading the adcdat mmr. when the adc is performing a conversion, the status of the adc can be read externally via the adc busy function of pin c3. this pin is high during a conversion. when the conversion is finished, adc busy returns to low. this information can be available on p0.2 (see the general-purpose input/output section) if enabled in the gp0con register. adcdat adc data result register . adcdat holds the 12-bit adc result, as shown in figure 15. adcrst adc reset register. ad crst resets all of the adc registers to their default values. adcgn adc gain calibration register for non-pga channels. adcof adc offset calibration register for all adc channels. pga_gn gain of pga_padc0 and pga_padc1.
ADUC7121 rev. 0 | page 30 of 96 table 29. adccon mmr bit designations (address = 0xffff0500, default value = 0x00000a00) bit value description 31:16 these bits are reserved. 15 positive adc buffer bypass. 0 set to 0 by the user to enable the positive adc buffer. 1 set to 1 by the user to bypass the positive adc buffer. 14 negative adc buffer bypass. 0 set to 0 by the user to enable the negative adc buffer. 1 set to 1 by the user to bypass the negative adc buffer. 13:11 adc clock speed. f adc = f core conversion = 19 adc clocks + acquisition time 000 f adc divide-by-1. this divider is provided to obtain a 1 msps adc with an external clock of <41.78 mhz. 001 f adc divide-by-2 (default value). 010 f adc divide-by-4. 011 f adc divide-by-8. 100 f adc divide-by-16. 101 f adc divide-by-32. 10:8 adc acquisition time (number of adc clocks). 000 2 clocks. 001 4 clocks. 010 8 clocks (default value). 011 16 clocks. 100 32 clocks. 101 64 clocks. 7 enable conversion. set by the user to 1 to enable conversion mode. cleared by the user to 0 to disable conversion mode. 6 reserved. the user sets this bit to 0. 5 adc power control. 1 set by the user to 1 to place the adc in normal mode . the adc must be powered up for at least 5 s before it converts correctly. 0 cleared by the user to 0 to place the adc in power-down mode. conversion mode. 00 single-ended mode. 01 differential mode. 10 pseudo differential mode. 4:3 11 reserved. conversion type. 000 enable the adc convst function on pin f3 as a conversion input. 001 enable timer1 as a conversion input. 010 enable timer0 as a conversion input. 011 single software conversion. automatically set to 000 after conversion. 100 continuous software conversion. 101 pla conversion. 110 pwm conversion. 2:0 other reserved.
ADUC7121 rev. 0 | page 31 of 96 table 30. adccp 1 mmr bit designations bit value description 7:5 reserved positive channel selection bits 00000 padc0p 00001 padc1p 00010 reserved 00011 reserved 00100 reserved 00101 reserved 00110 adc4 00111 adc5 01000 adc6 01001 adc7 01010 adc8 01011 adc9 01100 adc10/aincm 01101 temperature sensor 01110 dvdd_idac0 01111 dvdd_idac1 10000 dvdd_idac2 10001 dvdd_idac3 10010 dvdd_idac4 4:0 10011 iovdd_mon 10100 reserved 10101 reserved 10110 v ref 10111 agnd others reserved 1 adc channel availability depends on part model. table 31. adccn 1 mmr bit designations bit value description 7:5 reserved negative channel selection bits 00000 padc0n 00001 padc1n 00010 reserved 00011 reserved 00100 reserved 00101 reserved 00110 adc4 00111 adc5 01000 adc6 01001 adc7 01010 adc8 01011 adc9 01100 adc10/aincm 01101 v ref 01110 agnd 01111 pgnd 10000 iognd 4:0 others reserved 1 adc channel availability depends on part model. table 32. adcsta mmr bit designations bit value description 0 1 indicates that an adc conversion is complete. it is set automatically after an adc conversion completes. 0 0 automatically cleared by reading the adcdat mmr. table 33. adcdat mmr bit designations bit value description 27:16 holds the adc result (see figure 15 ). table 34. adcrst mmr bit designations bit value description 0 1 set to 1 by the user to reset all the adc registers to their default values. table 35. pga_gn mmr bit designations 1 bit value 2 description 11:6 n/a gain of pga for padc0 = 1 + 4 (pga_padc0_gn/32). 5:0 n/a gain of pga for padc1 = 1 + 4 (pga_padc1_gn/32). 1 pga_padc0_gn and pga_padc1_gn must be 32. 2 n/a means not applicable. table 36. adcgn mmr bit designations bit value 1 description 11:6 n/a these bits are reserved. 9:0 n/a 10-bit adc gain calibration value for non-pga channels. 1 n/a means not applicable. table 37. adcof mmr bit designations bit value 1 description 15:10 n/a these bits are reserved. 9:0 n/a 10-bit adc offset calibration value. 1 n/a means not applicable. converter operation the adc incorporates a successive approximation (sar) architecture involving a charge sampled input stage. this architecture is described for the three different modes of operation: differential, pseudo differential, and single-ended. differential mode the aduc121 contains a successive approximation adc based on two capacitive dacs. figure 1 and figure 1 show simplified schematics of the adc in acquisition and conversion phase respectively. the adc comprises control logic a sar and two capacitive dacs. in figure 1 (the acquisition phase) sw3 is closed and sw1 and sw2 are in position a. the comparator is held in a balanced condition and the sampling capacitor arrays acquire the differential signal on the input.
ADUC7121 rev. 0 | page 32 of 96 capacitive dac capacitive dac control logic comparator sw3 sw1 a a b b sw2 c s c s v ref ain0 ain11 mux channel+ channel? 09492-018 figure 18. adc acquisition phase when the adc starts a conversion (see figure 19 ), sw3 opens, and sw1 and sw2 move to position b, causing the comparator to become unbalanced. both inputs are disconnected as soon as the conversion begins. the control logic and the charge redistribu- tion dacs are used to add and subtract fixed amounts of charge from the sampling capacitor arrays to return the comparator to a balanced condition. when the comparator is rebalanced, the conversion is complete. the control logic generates the adc output code. the output impedances of the sources driving the v in+ input and the v in? input must be matched; otherwise, the two inputs have different settling times, resulting in errors. capacitive dac capacitive dac control logic comparator sw3 sw1 a a b b sw2 c s c s v ref ain0 ain11 mux channel+ channel? 09492-019 figure 19. adc conversion phase pseudo differential mode in pseudo differential mode, channel? is linked to the v in? input of the ADUC7121, and sw2 switches between a (channel?) and b (v ref ). the v in? input must be connected to ground or a low voltage. the input signal on v in+ can then vary from v in? to v ref + v in? . note that v in? must be chosen so that v ref + v in? does not exceed av dd . capacitive dac capacitive dac control logic comparator sw3 sw1 a a b b sw2 c s c s v ref ain0 ain11 v in? mux channel+ channel? 09492-020 figure 20. adc in pseudo differential mode single-ended mode in single-ended mode, sw2 is always connected internally to ground. the v in? input pin can be floating. the input signal range on v in+ is 0 v to v ref . capacitive dac capacitive dac control logic comparator sw3 sw1 a b c s c s ain0 ain11 mux channel+ channel? 09492-021 figure 21. adc in single-ended mode analog input structure figure 22 shows the equivalent circuit of the analog input structure of the adc. the four diodes provide esd protection for the analog inputs. take care to ensure that the analog input signals never exceed the supply rails by more than 300 mv. voltage in excess of 300 mv causes these diodes to become forward biased and to start conducting into the substrate. these diodes can conduct up to 10 ma without causing irreversible damage to the part. the c1 capacitors in figure 22 are typically 4 pf and can be primarily attributed to pin capacitance. the resistors are lumped components made up of the on resistance of the switches. the value of these resistors is typically about 100 . the c2 capacitors are the adc sampling capacitors and have a capacitance of 16 pf typical. a v dd c1 d d r1 c2 av dd c1 d d r1 c2 09492-022 figure 22. equivalent analog input circuit conversion phase: switches open, track phase: switches closed for ac applications, removing high frequency components from the analog input signal is recommended with an rc low-pass filter on the relevant analog input pins. in applications where harmonic distortion and signal-to-noise ratio are critical, drive the analog input from a low impedance source. large source impedances significantly affect the ac performance of the adc and can necessitate the use of an input buffer amplifier. the choice of the op amp is a function of the particular application. figure 23 and figure 24 give an example of an adc front end. 09492-023 ADUC7121 adc0 10 ? 0.01f figure 23. buffering single-e nded/pseudo differential input
ADUC7121 rev. 0 | page 33 of 96 09492-024 ADUC7121 adc0 v ref adc1 band gap reference the ADUC7121 provides an on-chip band gap reference of 2.5 v that can be used for the adc and for the dac. this 2.5 v refer- ence is generated from a 1.2 v reference. this internal reference also appears on the v ref pins (v ref _2.5 and v ref _1.2). when using the internal reference, a capacitor of 0.47 f must be connected between each external v ref pin and agnd to ensure stability and fast response during adc conversions. this reference can also be connected to the external pin, buf_vref2, and used as a reference for other circuits in the system. figure 24. buffering differential inputs when no amplifier is used to drive the analog input, limit the source impedance to values lower than 1 k. the maximum source impedance depends on the amount of total harmonic distortion (td) that can be tolerated. the td increases as the source impedance increases and the performance degrades. the band gap reference also connects through buffers to the buf_ref1 and the buf_ref2 pins. to damp the noise, connect a minimum of 0.1 f capacitor to these pins. the band gap reference interface consists of an 8-bit refcon mmr, described in table 39 . driving the analog inputs an internal or external reference can be used for the adc. in differential mode of operation, there are restrictions on the common-mode input signal (v cm ). these restrictions are dependent on the reference value and supply voltage used to ensure that the signal remains within the supply rails. table 38 gives some calculated v cm minimum and v cm maximum values. table 38. v cm ranges av dd v ref v cm min v cm max signal peak-to-peak 2.5 v 1.25 v 2.05 v 2.5 v 2.048 v 1.024 v 2.276 v 2.048 v 3.3 v 1.25 v 0.75 v 2.55 v 1.25 v 2.5 v 1.25 v 1.75 v 2.5 v 2.048 v 1.024 v 1.976 v 2.048 v 3.0 v 1.25 v 0.75 v 2.25 v 1.25 v table 39. refcon mmr bit designations (address = 0xffff0480, default value = 0x01) bit description 7:1 reserved. 2 buf_vref1/buf_vref2 is driven from the internal 2.5 v reference when set to 1. 1 internal 2.5 v reference output enable. set by the user to connect the internal 2.5 v reference to the v ref _2.5 pin. cleared by the user to disconnect the reference from the v ref _2.5 pin. the v ref _2.5 pin should also be cleared to connect an external reference source to it. 0 internal 1.2 v reference output enable. set by the user to connect the internal 1.2 v reference to the v ref _1.2 pin. cleared by the user to disconnect the reference from the v ref _1.2 pin.
ADUC7121 rev. 0 | page 34 of 96 power supply monitor the power supply monitor on the ADUC7121 indicates when the iov dd supply pin drops below one of two supply trip points. the monitor function is controlled via the psmcon register. if enabled in the irqen or fiqen register, the monitor interrupts the core using the psmi bit in the psmcon mmr. this bit is cleared immediately after cmp goes high. note that if the interrupt generated is exited before cmp goes high (iovdd supply voltage is above the trip point), no further interrupts are generated until cmp returns high. the user needs to ensure that the code execution remains within the isr until cmp returns high. this monitor function allows the user to save working registers to avoid possible data loss due to low supply or brownout con- ditions. it also ensures that normal code execution does not resume until a safe supply level has been established. the psm does not operate correctly when using jtag debug; therefore, disable psm while in jtag debug mode. table 40. psmcon mmr bit designations (a ddress = 0xffff0440, default value = 0x0008) bit name description 15:4 reserved these bits are reserved. 3 cmp comparator bit. this is a read-only bit that directly reflects the state of the comparator. read 1 indicates that the iov dd supply is above its selected trip point or the psm is in power-down mode. read 0 indicates the iov dd supply is below its selected trip point. set this bit before leaving the interrupt service routine. trip point selection bit. 0 = 2.79 v. 2 tp 1 = 3.07 v. 1 psmen power supply monitor enable bit. set to 1 by the user to enable the power supply monitor circuit. cleared to 0 by the user to disa ble the power supply monitor circuit. 0 psmi power supply monitor interrupt bit. th is bit is set high by the microconve rter if cmp is low, indicating low i/o supply. the psmi bit can be used to interrupt th e processor. when cmp returns high, the psmi bit can be cleared by writing a 1 to this location. a write of 0 has no effect. there is no timeout delay. psmi can be cleared immediately after cmp goes high.
ADUC7121 rev. 0 | page 35 of 96 nonvolatile flash/ee memory flash/ee memory overview the ADUC7121 incorporates flash/ee memory technology on chip to provide the user with nonvolatile, in circuit reprogram- mable memory space. similar to eeprom, flash memory can be programmed in system at a byte level, although it must first be erased. the erase is performed in page blocks. as a result, flash memory is often (and more correctly) referred to as flash/ee memory. overall, flash/ee memory represents a step closer to the ideal memory device that includes no volatility, in circuit program- mability, high density, and low cost. incorporated in the ADUC7121, flash/ee memory technology allows the user to update program code space in circuit, without the need to replace one time programmable (otp) devices at remote operating nodes. flash/ee memory the ADUC7121 contains two 64 kb arrays of flash/ee memory. in the first block, the lower 62 kb is available to the user and the upper 2 kb of this flash/ee memory array program contain permanently embedded firmware, allowing in circuit serial down- load. the 2 kb of embedded firmware also contain a power-on configuration routine that downloads factory calibrated coefficients to the various calibrated peripherals (band gap references and so forth). this 2 kb embedded firmware is hidden from user code. it is not possible for the user to read, write, or erase this page. in the second block, all 64 kb of flash/ee memory are available to the user. the 126 kb of flash/ee memory can be programmed in circuit using the serial download mode or the jtag mode. flash/ee memory reliability the flash/ee memory arrays on the ADUC7121 are fully qualified for two key flash/ee memory characteristics: flash/ee memory cycling endurance and flash/ee memory data retention. endurance quantifies the ability of the flash/ee memory to be cycled through many program, read, and erase cycles. a single endurance cycle is composed of four independent, sequential events, defined as follows: 1. initial page erase sequence 2. read/verify sequence a single flash/ee 3. byte program sequence memory 4. second read/verify sequence endurance cycle in reliability qualification, every half word (16-bit wide) location of the three pages (top, middle, and bottom) in the flash/ee memory is cycled 10,000 times from 0x0000 to 0xffff. as indicated in the specifications section, the flash/ee memory endurance qualification is carried out in accordance with jedec retention lifetime specification a117 over the industrial temperature range of C10 to +95c. the results allow the specification of a minimum en durance figure over a supply temperature of 10,000 cycles. retention quantifies the ability of the flash/ee memory to retain its programmed data over time. again, the parts are qualified in accordance with the formal jedec retention lifetime specification a117 at a specific junction temperature (t j = 85c). as part of this qualification procedure, the flash/ee memory is cycled to its specified endurance limit, described previously, before data retention is characterized. this means that the flash/ee memory is guaranteed to retain its data for its fully specified retention lifetime every time the flash/ee memory is reprogrammed. note, too, that retention lifetime, based on activation energy of 0.6 ev, derates with t j , as shown in figure 25 . 150 300 450 600 30 40 55 70 85 100 125 135 150 retention (years) 0 09492-025 junction temperature (c) figure 25. flash/ee memory data retention serial downloading (in-circuit programming) the ADUC7121 facilitates code download via the i 2 c serial port. the ADUC7121 enters serial download mode after a reset or power cycle if the bm function of the p3.7/ bm /plao[11] pin is pulled low through an external 1 k resistor. this is combined with the state of address 0x00014 in the flash. if this address is 0xffffffff and bm is pulled low, the part enters download mode; if this address contains any other value, user code is executed. when in serial download mode, the user can download code to the full 126 kb of flash/ee memory while the device is in circuit in its target application hardware. a pc serial download executable and hardware dongle are provided as part of the development system for serial downloads via the i 2 c port. jtag access the jtag protocol uses the on-chip jtag interface to facilitate code download and debug. flash/ee memory security the 126 kb of flash/ee memory available to the user can be read and write protected. bit 31 of the fee0pro/fee0hid mmr protects the 126 kb from being read through jtag and also in i 2 c programming mode. the other 31 bits of this register protect
ADUC7121 rev. 0 | page 36 of 96 writing to the flash/ee memory; each bit protects four pages, that is, 2 kb. write protection is activated for all access types. fee1pro and fee1hid similarly protect the second 64 kb block. all 32 bits of this are used to protect four pages at a time. three levels of protection protection can be set and removed by writing directly into the feexhid mmr. this protection does not remain after reset. protection can be set by writing into the feexpro mmr. it takes effect only after a save protection command (0x0c) and a reset. the feexpro mmr is protected by a key to avoid direct access. the key is saved one time only and must be reentered to modify feexpro. a mass erase sets the key back to 0xffff but also erases all the user code. the flash/ee memory can be permanently protected by using the feepro mmr and a particular value of the 0xdeaddead key. entering the key again to modify the feexpro register is not allowed. sequence to write the key to protection registers 1. write the bit in feexpro corresponding to the page to be protected. 2. enable key protection by setting bit 6 of feexmod (bit 5 must equal 0). 3. write a 32-bit key in feexadr, feexdat. 4. run the write key command 0x0c in feexcon; wait for the read to be successful by monitoring feexsta. 5. reset the part. to remove or modify the protection, the same sequence is used with a modified value of feexpro. if the key chosen is the value 0xdead, then the memory protection cannot be removed. only a mass erase unprotects the part, but it also erases all user code. the sequence to write the key is shown in the following example; this protects writing page 4 to page 7 of the flash/ee memory: fee0pro=0xfffffffd; / /protect page 4 to page 7 fee0mod=0x48; //write key enable fee0adr=0x1234; //16-bit key value fee0dat=0x5678; //16-bit key value fee0con= 0x0c; //write key command follow the same sequence to permanently protect the part with feexadr = 0xdead and feexdat = 0xdead . flash/ee control interface fee0dat register fee0dat is a 16-bit data register. name: fee0dat address: 0xffff0e0c default value: 0xxxxx access: read and write fee0adr register fee0adr is a 16-bit address register. name: fee0adr address: 0xffff0e10 default value: 0x0000 access: read and write fee0sgn register fee0sgn is a 24-bit code signature. name: fee0sgn address: 0xffff0e18 default value: 0xffffff access: read only fee0pro register fee0pro provides protection following subsequent reset mmr. it requires a software key (see table 41 ). name: fee0pro address: 0xffff0e1c default value: 0x00000000 access: read and write fee0hid register fee0hid provides immediate protection mmr. it does not require any software keys (see table 41 ). name: fee0hid address: 0xffff0e20 default value: 0xffffffff access: read and write.
ADUC7121 rev. 0 | page 37 of 96 table 41. fee0pro and fee0 hid mmr bit designations bit description 31 read protection. cleared by the user to protect block 0. set by the user to allow reading block 0. 30:0 write protection for page 123 to page 120, for page 119 to page 116, and for page 0 to page 3. cleared by the user to protect the pages in writing. set by the user to allow writing the pages. command sequence for executing a mass erase fee0dat = 0x3cff; fee0adr = 0xffc3; fee0mod = fee0mod|0x8; //erase key enable fee0con = 0x06; //mass erase command fee1dat register fee1dat is a 16-bit data register. name: fee1dat address: 0xffff0e8c default value: 0xxxxx access: read and write fee1adr register fee1adr is a 16-bit address register. name: fee1adr address: 0xffff0e90 default value: 0x0000 access: read and write fee1sgn register fee1sgn is a 24-bit code signature. name: fee1sgn address: 0xffff0e98 default value: 0xffffff access: read only fee1pro register fee1pro provides protection following subsequent reset mmr. it requires a software key (see table 42 ). name: fee1pro address: 0xffff0e9c default value: 0x00000000 access: read and write fee1hid register fee1hid provides immediate protection mmr. it does not require any software keys (see table 42 ). name: feehid address: 0xffff0ea0 default value: 0xffffffff access: read and write table 42. fee1pro and fee1 hid mmr bit designations bit description 31 read protection. cleared by the user to protect block 1. set by the user to allow reading block 1. 30 write protection for page 127 to page 120. cleared by the user to protect the pages in writing. set by the user to allow writing the pages. 29:0 write protection for page 119 to page 116 and for page 0 to page 3. cleared by the user to protect the pages in writing. set by the user to allow writing the pages. fee0sta register name: fee0sta address: 0xffff0e00 default value: 0x0000 access: read and write fee1sta register name: fee1sta address: 0xffff0e80 default value: 0x0000 access: read and write table 43. feexsta mmr bit designations bit description 15:6 reserved. 5 reserved. 4 reserved. 3 flash/ee interrupt status bit. set automatically when an interrupt occurs, that is, when a command is complete and the flash/ee interrupt enable bit in the feexmod register is set. cleared when reading feexsta register. 2 flash/ee controller busy. set automatically when the controller is busy. cleared automatically when the controller is not busy.
ADUC7121 rev. 0 | page 38 of 96 bit description 1 command fail. set automatically when a command completes unsuccessfully. cleared automatically when reading feexsta register. 0 command complete. set by microconverter when a command is complete. cleared automatically when reading feexsta register. fee0mod register name fee0mod address 0xffff0e04 default value 0x0 access read and write fee1mod register name fee1mod address 0xffff0e4 default value 0x0 access read and write table 44. feexmod mmr bit designations bit description 7:5 reserved. these bits are always set to 0 except when writing keys. see the sequence to write the key to protection registers section for details. 4 flash/ee interrupt enable. set by the user to enable the flash/ee interrupt. the interrupt occurs when a command is complete. cleared by the user to disable the flash/ee interrupt. 3 erase/write command protection. set by the user to enable the erase and write commands. cleared to protect the flash/ee memory against erase/write command. 2 reserved. the user must set this bit to 0. 1:0 flash/ee wait states. both fl ash/ee blocks must have the same wait state value for any change to take effect. fee0con register name fee0con address 0xffff0e0 default value 0x00 access read and write fee1con register name fee1con address 0xffff0e default value 0x00 access read and write table 45. command codes in feexcon code command description 0x00 1 null idle state. 0x01 1 single read load feexdat with the 16-bit data indexed by feexadr. 0x02 1 single write write feexdat at the address pointed by feexadr. this operation takes 50 s. 0x03 1 erase/write erase the page indexed by feexadr and write feex dat at the location pointed by feexadr. this operation takes 20 ms. 0x04 1 single verify compare the contents of the location pointed by feexadr to the data in feexdat. the result of the comparison is returned in feexsta bit 1. 0x05 1 single erase erase the page indexed by feexadr. 0x06 1 mass erase erase user space. the 2 kb of kernel are protected in block 0. this operation takes 2.48 sec. to prevent accidental execution, a command sequence is re quired to execute this instruction. 0x07 reserved reserved. 0x08 reserved reserved. 0x09 reserved reserved. 0x0a reserved reserved. 0x0b signature gives a signature of the 64 kb of flash/ee in th e 24-bit feexsign mmr. this ope ration takes 32,778 clock cycles. 0x0c protect this command can be run only once. the value of f eexpro is saved and can be removed only with a mass erase (0x06) or with the key. 0x0d reserved reserved. 0x0e reserved reserved. 0x0f ping no operation, interrupt generated. 1 the feexcon register always reads 0x07 immediat ely after execution of any of these commands.
ADUC7121 rev. 0 | page 39 of 96 execution time from sram and flash/ee this section describes sram and flash/ee access times during execution for applications where execution time is critical. execution from sram fetching instructions from sram takes one clock cycle because the access time of the sram is 2 ns and a clock cycle is 22 ns minimum. however, if the instruction involves reading or writing data to memory, one extra cycle must be added if the data is in sram (or three cycles if the data is in flash/ee), one cycle to execute the instruction, and two cycles to retrieve the 32-bit data from flash/ee. a control flow instruction, such as a branch instruction, takes one cycle to fetch, but it also takes two cycles to fill the pipeline with the new instructions. execution from flash/ee because the flash/ee width is 16 bits and access time for 16-bit words is 23 ns, execution from flash/ee cannot be accomplished in one cycle (as can be done from sram when the cd bit = 0). in addition, some dead times are needed before accessing data for any value of cd bits. in arm mode, where instructions are 32 bits, two cycles are needed to fetch any instruction when cd = 0. in thumb mode, where instructions are 16 bits, one cycle is needed to fetch any instruction. timing is identical in both modes when executing instructions that involve using the flash/ee for data memory. if the instruction to be executed is a control flow instruction, an extra cycle is needed to decode the new address of the program counter and then four cycles are needed to fill the pipeline. a data processing instruction involving only core registers does not require any extra clock cycles, but if it involves data in flash/ee, one additional clock cycle is needed to decode the address of the data and two additional cycles are needed to obtain the 32-bit data from flash/ee. an extra cycle must also be added before fetching another instruction. data transfer instructions are more complex and are summarized in table 46. table 46. execution cycles in arm/thumb mode instructions fetch cycles dead time data access dead time ld 2/1 1 2 1 ldh 2/1 1 1 1 ldm/push 2/1 n 2 n n str 2/1 1 2 20 s 1 strh 2/1 1 20 s 1 strm/pop 2/1 n 2 n 20 s n with 1 < n 16, n is the number of bytes of data to load or store in the multiple load/store instruction. the swap instruction combines an ld and str instruction with only one fetch, giving a total of eight cycles plus 40 s . reset and remap the arm exception vectors are situated at the bottom of the memory array, from address 0x00000000 to address 0x00000020, as shown in figure 26. kernel interrupt service routines interrupt service routines arm exception vector addresses 0x00000020 0x00041fff 0x0008ffff 0xffffffff flash/ee sram mirror space 0x00000000 0x00000000 0x00040000 0x00080000 09492-026 figure 26. remap for exception execution by default and after any reset, the flash/ee is mirrored at the bottom of the memory array. the remap function allows the programmer to mirror the sram at the bottom of the memory array, facilitating execution of exception routines from sram instead of from flash/ee. this means exceptions are executed twice as fast, with the exception being executed in arm mode (32 bits), and the sram being 32 bits wide instead of being 16-bit wide flash/ee memory. remap operation when a reset occurs on the ADUC7121, execution starts auto- matically in factory programmed internal configuration code. this kernel is hidden and cannot be accessed by user code. if the ADUC7121 is in normal mode (the p3.7/ bm /plao[11] pin is high), it executes the power-on configuration routine of the kernel and then jumps to the reset vector address 0x00000000 to execute the users reset exception routine. because the flash/ee is mirrored at the bottom of the memory array at reset, the reset interrupt routine must always be written in flash/ee. the remap is performed from flash/ee by setting bit 0 of the remap register. precautions must be taken to execute this command from flash/ee (above address 0x00080020) and not from the bottom of the array because this, the defined memory space, is replaced by the sram. this operation is reversible: the flash/ee can be remapped at address 0x00000000 by clearing bit 0 of the remap mmr. precaution must again be taken to execute the remap function from outside the mirrored area. any kind of reset remaps the flash/ee memory at the bottom of the array.
ADUC7121 rev. 0 | page 40 of 96 reset operation there are four types of reset: external reset, power-on reset, watchdog expiration, and software force. the rststa register indicates the source of the last reset and rstclr clears the rststa register. these registers can be used during a reset exception service routine to identify the source of the reset. if rststa is null, the reset was external. note that when clearing rststa, all bits that are currently set to 1 must be cleared. otherwise, a reset event occurs. table 47. remap mmr bit de signations (address = 0xffff0220, default value = 0x00) bit name description 0 remap remap bit. set by the user to remap the sram to address 0x00000000. cleared automatically after reset to remap the flash/ee memory to address 0x00000000. table 48. rststa mmr bit designations (a ddress = 0xffff0230, default value = 0x0x) bit description 7:3 reserved. 2 software reset. set by the user to force a software reset. cleared by setting the co rresponding bit in rstclr. 1 watchdog timeout. set automatically when a watchdog timeout occurs. cleared by setting the co rresponding bit in rstclr. 0 power-on reset. set automatically when a power-on reset occurs. cleared by setting the co rresponding bit in rstclr.
ADUC7121 rev. 0 | page 41 of 96 other analog peripherals digital-to-analog converters the ADUC7121 incorporates four buffered 12-bit voltage output string digital-to-analog converters (dacs) on chip. each dac has a rail-to-rail voltage output buffer capable of driving 5 k/100 pf. each dac has three selectable ranges: 0 v to v ref (internal band gap 2.5 v reference), 0 v to av dd , and 0 v to ext_ref (see figure 27). the signal range is 0 v to av dd . note that the dac can also operate in interpolation mode. mmr interfaces each dac is independently configurable through a control register and a data register. these two registers are identical for the 12 dacs. only dac0con and dac0dat are described in detail in this section. 09492-027 dac0 sw_a0 sw_c0 sw_b0 av dd ext_ref string dac sw_d0 sw_a12 sw_c11 sw_b11 av dd ext_ref string dac sw_d11 dac_buf dac_buf dac12 int_ref + ? dac_rebuf int_ref + ? dac_rebuf . . . . . . . . . . . . figure 27. dac configuration 09492-028 dacout 12 12 16 sw_b dac_buf sw_c string dac hclk uclk timer1 div 16/32 interpolator data_reg figure 28. dac user functionality
ADUC7121 rev. 0 | page 42 of 96 table 49 dacxcon registers (default value = 0x100, read/write access) name address dac0con 0xffff0580 dac1con 0xffff0588 dac2con 0xffff05b0 dac3con 0xffff05d8 table 50. dac0con mmr bit designations bit value name description 15:9 0 reserved. 8 1 dacpd dac power-down. set by the us er to set dacoutx to tristate mode. 7 0 dacbuf_lp dac buffer low power mode. set by the user to place dac_buff into a low power mode. 6 0 byp dac bypass bit. set this bit to bypass the dac buffer. cleared to buffer the dac output. 5 0 dacclk dac update rate. set by the user to update the dac using timer1. cleared by the user to update the dac using hclk (core clock). 4 0 dacclr dac clear bit. set by the user to enable normal dac operation. cleared by the user to reset data register of the dac to 0. 3 0 mode mode bit. set by the user to operate on dac normal mode and turn off the interpol ator clock source. cleared by the user to enable the interpolation mode. 2 0 rate rate bit. set by the user to enable the inter polation clock to hclk/16. clea red by the user to hclk/32. 1:0 dacrnx dac range bits. 00 dac range is from agnd to the internal reference. 01 ext_ref dac range is from agnd to the external reference. see the refcon mmr in table 39 for details. 10 ext_ref dac range is from agnd to the ex ternal reference. see the refcon mmr in table 39 for more details. 11 avdd and agnd. table 51. dacxdat registers (default value = 0x00000000, read/write access) name address dac0dat 0xffff0584 dac1dat 0xffff058c dac2dat 0xffff05b4 dac3dat 0xffff05dc table 52. dacxdat mmr bit designations bit description 31:28 reserved. 27:16 12-bit data for dacx. 15:12 extra bits for interpolation mode. 11:0 reserved.
ADUC7121 rev. 0 | page 43 of 96 using the dacs the on-chip dac architecture cons ists of a resistor string dac followed by an output buffer ampl ifier. the functional equivalent is shown in figure 29 . 09492-029 r r r r r dac0 v ref av dd ext_ref figure 29. dac structure as shown in figure 29 , the reference source for each dac is user- selectable in software. it can be either av dd , v ref , or ext_ref. in 0 v-to-av dd mode, the dac output transfer function spans from 0 v to the voltage at the avdd pin. in 0 v-to-ext_ref mode, the dac output transfer function spans from 0 v to the voltage at the v ref _2.5 pin. in 0 v-to-v ref mode, the dac output transfer function spans from 0 v to the internal 2.5 v reference, v ref . the dac output buffer amplifier features a true rail-to-rail output stage implementation. this means that, when unloaded, each output is capable of swinging to within less than 5 mv of both av dd and ground. moreover, the linearity specification of the dac (when driving a 5 k resistive load to ground) is guaranteed through the full transfer function except for code 0 to code 100, and, in 0 v-to-av dd mode only, code 3995 to code 4095. linearity degradation near ground and av dd is caused by satu- ration of the output amplifier, and a general representation of its effects (neglecting offset and gain error) is shown in figure 30 . the dotted line in figure 30 indicates the ideal transfer function, and the solid line represents what the transfer function may look like with endpoint nonlinearities due to saturation of the output amplifier. note that figure 30 represents a transfer function in 0 v- to-av dd mode only. in 0 v-to-v ref or 0 v-to-ext_ref modes (with v ref < av dd or ext_ref < av dd ), the lower nonlinearity is similar. however, the upper portion of the transfer function follows the ideal line right to the end (v ref in this case, not av dd ), showing no signs of endpoint linearity errors. 09492-030 av dd av dd ? 100mv 100mv 0x00000000 0x0fff0000 figure 30. endpoint nonlineariti es due to amplifier saturation the endpoint nonlinearities conceptually illustrated in figure 30 worsen as a function of output loading. the ADUC7121 data sheet specifications assume a 5 k resistive load to ground at the dac output. as the output is forced to source or sink more current, the nonlinear regions at the top or bottom (respectively) of figure 30 become larger. with larger current demands, this can significantly limit output voltage swing. ldo (low dropout regulator) the ADUC7121 contains an integrated ldo, which generates the core supply voltage (dvdd) of approximately 2.6 v from the iovdd supply. as the ldo is driven from iovdd, the iovdd supply voltage needs to be greater than 2.7 v. an external compensation capacitor (ct) of 0.47 f with low esr must be placed very close to each of the dvdd pins. this capacitor also acts as a storage tank of charge, and supplies an instantaneous charge required by the core, particularly at the positive edge of the core clock (hclk). the dvdd voltage generated by the ldo is solely for providing a supply for the ADUC7121. therefore, users should not use a dvdd pin as the power supply pin for any other chip. in addition, it is recommended that the iovdd has excellent power supply decoupling to help improve line regulation performance of the ldo. the dvdd pin has no reverse battery, current limit, or thermal shutdown protection; therefore, it is essential that users of the ADUC7121 do not short this pin to ground at any time during normal operation or during board manufacture. current output dacs (idac) the ADUC7121 provides five curr ent output digital-to-analog converters (dacs). the current sources (five current dacs) feature low noise and low drift high-side current output with 11-bit resolution. the five idacs are as follows: idac0 with 250 ma full-scale (fs) output, idac1 with 200 ma fs output, idac2 with 80 ma fs output, idac3 with 45 ma fs output, and idac4 with 20 ma fs output.
ADUC7121 rev. 0 | page 44 of 96 the reference current of each idac is generated by a precision internal band gap voltage reference and an external precision resistor, and as such, the gain error of each idac is impacted by the accuracy of the external resistor. connect the resistor to the i ref pin. the noise of each idac is limited by its damping capacitor, c damp , which is selected to band limit noise as well as to meet the signal bandwidth. connect c damp _idacx to pgnd. an nmos switch is provided to shut down the idac0 diode. note that the output current switches off while this switch is on. when the switch is on, the idac0 pin is able to withstand ?0.5 v. at power-up or reset, idac0 is powered down by default and its output is high impedance. when enabled, the idac0 output current does not overshoot. to reduce the heat dissipation on chip, a separate power supply can be used. an internal ldo provides a stable 2.5 v supply for all low current internal idacs. precision current generati on and fault protection the reference current is generated either from an on-chip precision band gap voltage source or from an external voltage reference by default, which is applied to an external precision resistor. this resistor is connected to the i ref pin. the band gap is factory trimmed to obtain a precise initial value and low temperature drift. the external resistor is an assumed 0.1% accuracy with 5 ppm drift, and a 0.1 f external capacitor is required to bypass high frequency noise. a fault detection block is included to stop problems from occurring if too small a reference resistor is detected. by sending the devel- oped reference current into an on-board resistor of half the expected size of the external resistor, a fault signal is generated if the resistor is less than half the expected value (to an accuracy of about 20%). the external resistor value is calculated by r ext = v ref /i ref , where i ref = 370.37 a and v ref is the selected reference voltage for the voltage-to-current circuit. idac and output stage fault protection all five idacs use the same architecture to generate high-side current whereby only the section that generates the reference current is shared. a low current is generated first using a current- mode dac, which is then mirrored up to give the large output current that is desired. a thermal shutdown circuit protects the chip from overheating. the idacs are guaranteed monotonic to within 11 bits of resolution. the bandwidth limit is provided by a programmable internal resistor and an external capacitor. this is to filter high frequency noise. it is also used to generate a triangle wave from a square wave input for the idac4 only. the thermal shutdown circuit automatically shuts down all of the output stages when the chip temperature exceeds a certain threshold. the intention of the thermal shutdown is only for protection in the case of a short on an idac output. the over- heating of the chip from other causes also triggers a thermal shutdown but only the idac output stage is automatically shut down. it triggers an interrupt and sets the tshut bit in the idacsta register to indicate the overheating of the chip. in case the digital core malfunctions at a temperature lower than the thermal shutdown trigger point, the circuit can still shut down the idac, but a watchdog reset must be used to reset the chip. the tshut bit retains its value after a software reset or a watchdog reset. this bit can only be cleared by a power-on reset, a hardware reset, or when 0 is written to the idacsta register.
ADUC7121 rev. 0 | page 45 of 96 i dac buf buf voltage reference ldo 2.5v 3.3v i ref c damp i out pvdd r ext 0.47f pull_down pgnd 09492-031 figure 31. idac mmrs table 53. idac control registers (read and write access) name address (hex) default value idac0con 0xffff0700 0x0010 idac1con 0xffff070c 0x0010 idac2con 0xffff0718 0x0010 idac3con 0xffff0724 0x0010 idac4con 0xffff0730 0x0010 tdscon 0xffff073c 0x00 idac0pulldown 0xffff0744 0x00 table 54. idacxcon mmr bit designations bit name value description 15:9 these bits are reserved. 8:7 sfhmode bit shuffling is a method of increasing the ac precision of an idac. do not use in applications where dc performance is important. 00 shuffle one increment at a time. 01 shuffle based on an internal counter. 10 shuffle based on the input data. 11 reserved. 6 msbshfen 0 msb shuffle enable. set by the user to 1 to enable msb shuffling. set by the user to 0 to disable msb shuffling. 5 lsbshfen 0 lsb shuffle enable. set by the user to 1 to enable lsb shuffling. set by the user to 0 to disable lsb shuffling. bit name value description 4 idacpd 1 idac power-down bit. set by the user to 1 to power down the idac. idac output is high impedance. set by the user to 0 to power up the idac. 3 idacclk 0 idac update rate. set by the user to update the idac using timer1. cleared by the user to update the idac using hclk (core clock). 2 idacclr 0 idac clear bit. set by the user to enable normal idac operation. cleared by the user to reset data register of the idac to 0. 1 mode 0 mode bit. this bit must always be cleared. 0 reserved 0 set this bit to 0. table 55. tdscon mmr bit designations bit value name description 7:3 reserved the user sets these bits to 0. 2 0 dislr disable low external resistance bit. set by the user to 0 to disable the output current dacs if the external resistance is lower than a trip point. 1 0 disint disable thermal trigger interrupt. set by the user to 0 to generate an interrupt if the temperature passes the thermal shutdown point. 0 0 dissd set by the user to 0 to disable the output current dacs when the temperature passes a trip point.
ADUC7121 rev. 0 | page 46 of 96 table 56. idac0pulldown mmr bit designations bit value name description 7:6 reserved these bits are set to 0 by the user. 5 0 pulldown idac0 pull-down. set to 1 by the user to pull down the idac0 pin as well as power down the idac0. set to 0 by the user to disable the pull-down. 4 0 pla_pd_en pla output trigger enable. set to 1 by the user to enable the pla output to trigger the idac0 pull-down. set to 0 by the user to disable this feature. 3:0 pla source pla output source for pla output trigger enable. can select the output of any element, 0 to 15, by programming these bits with the corresponding binary value. table 57. idac data registers (default value = 0x00000000, read and write access) name address (hex) idac0dat 0xffff0704 idac1dat 0xffff0710 idac2dat 0xffff071c idac3dat 0xffff0728 idac4dat 0xffff0734 table 58. idacxdat mmr bit designations bit name value description 31:28 reserved these bits are reserved. 27:16 data data from idacx. 15:0 reserved 000 these bits are reserved. table 59. idac bandwidth registers (default value = 0x00, read and write access) name address idac0bw 0xffff0708 idac1bw 0xffff0714 idac2bw 0xffff0720 idac3bw 0xffff072c idac4bw 0xffff0738 table 60. idacxbw mmr bit designations bit name value description 7:4 reserved the user sets these bits to 0. 3:0 bw bandwidth control bits. defines the 3 db bandwidth of the rc low-pass filter, assuming a 0.01 f capacitor on the c damp _idacx pins of the idacx. 000 100 khz. 001 28.7 khz. 010 15 khz. 011 7.8 khz. 100 4 khz. 101 2.2 khz. 110 1.2 khz. others not defined. table 61. idac status register (default value = 0x00, read and write access) name address (hex) idacsta 0xffff0740 table 62. idacsta mmr bit designations bit value name description 7:2 reserved these bits are set to 0 by the user. 1 0 tshut thermal shutdown error status bit. set to 1 by the core indicating a thermal shutdown event. set to 0 by the core indicating the idacs are within operating temperature. 0 0 extreslow external resistor short bit. set to 1 by the core indicating an external resistor short. set to 0 by the core when operating normally. oscillator and pllpower control the ADUC7121 integrates a 32.768 khz oscillator, a clock divider, and a pll. the pll locks onto a multiple (1275) of the internal oscillator to provide a stable 41.78 mhz clock for the system. the core can operate at this frequency, or at binary submultiples of it, to allow for power saving. the default core clock is the pll clock divided by 8 (cd = 3) or 5.2 mhz. the core clock frequency can be output on the xclk pin as described in figure 32 . note that when the xclk pin is used to output the core clock, the output signal is not buffered and is not suitable for use as a clock source to an external device without an external buffer. a power-down mode is available on the ADUC7121.
ADUC7121 rev. 0 | page 47 of 96 example source code the operating mode, clocking mode, and programmable clock divider are controlled via two mmrs, pllcon (see table 65 ) and powcon (see table 66 ). pllcon controls the operating mode of the clock system, and powcon controls the core clock frequency and the power-down mode. t2ld = 5; tcon = 0x480; while ((t2val == t2val_old) || (t2val > 3)) //ensures timer value loaded 09492-032 at power-up 41.78mhz oclk 32.768khz watchdog timer int. 32khz 1 oscillator crystal oscillator timers mdclk hclk pll core i 2 c uclk analog peripherals /2 cd cd xtalo xtali p1.4/xclk p1.4/eclk 1 32.768khz 3% irqen = 0x10; //enable t2 interrupt pllkey1 = 0xaa; pllcon = 0x01; pllkey2 = 0x55; powkey1 = 0x01; powcon = 0x27; // set core into nap mode powkey2 = 0xf4; external clock selection to switch to an external clock on p1.4 (of the p1.4/pwm1/eclk/xclk/plai[8] pin), configure p1.4 in mode 2. the external clock can be up to 41.78 mhz. figure 32. clocking system example source code external crystal selection t2ld = 5; to switch to an external crystal, use the following procedure: tcon = 0x480; 1. enable the timer2 interrupt and configure it for a timeout period of >120 s. while ((t2val == t2val_old) || (t2val > 3)) //ensures timer value loaded 2. follow the write sequence to the pllcon register, setting the mdclk bits to 01 and clearing the osel bit. irqen = 0x10; //enable t2 interrupt 3. force the part into nap mode by writing the correct write sequence to the powcon register. pllkey1 = 0xaa; 4. when the part is interrupted from nap mode by the timer2 interrupt source, the clock source has switched to the external clock. pllcon = 0x03; //select external clock pllkey2 = 0x55; powkey1 = 0x01; in noisy environments, noise can couple to the external crystal pins, and pll may lose lock momentarily. a pll interrupt is provided in the interrupt controller. the core clock is immediately halted, and this interrupt is serviced only when the lock is restored. powcon = 0x27; // set core into nap mode powkey2 = 0xf4; power control system in case of crystal loss, the watchdog timer should be used. during initialization, a test on the rststa register can determine if the reset came from the watchdog timer. a choice of operating modes is available on the ADUC7121. table 63 describes what part of the ADUC7121 is powered on in the different modes and indicates the power-up time. tabl e 64 gives some typical values of the total current consumption (analog + digital supply currents) in the different modes, depending on the clock divider bits. the adc is turned off. note that these values also include current consumption of the regulator and other parts on the test board on which these values were measured.
ADUC7121 rev. 0 | page 48 of 96 table 63. operating modes mode core peripherals pll xtal/timer2/timer3 external irq start-up/power-on time active on on on on on 66 ms at cd = 0 pause on on on on 24 ns at cd = 0; 3.06 s at cd = 7 nap on on on 24 ns at cd = 0; 3.06 s at cd = 7 sleep on on 1.58 ms stop on 1.7 ms table 64. typical current consumption at 25c pc[2:0] mode cd = 0 cd = 1 cd = 2 cd = 3 cd = 4 cd = 5 cd = 6 cd = 7 000 active 33.1 21.2 13.8 10 8.1 7.2 6.7 6.45 001 pause 22.7 13.3 8.5 6.1 4.9 4.3 4 3.85 010 nap 3.8 3.8 3.8 3.8 3.8 3.8 3.8 3.8 011 sleep 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 100 stop 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4
ADUC7121 rev. 0 | page 49 of 96 mmrs and keys to prevent accidental programming, a certain sequence must be followed when writing in the pllcon and powcon registers (see table 67 ). pllkeyx registers name: pllkey1 address: 0xffff0410 default value: 0x0000 access: write only name: pllkey2 address: 0xffff0418 default value: 0x0000 access: write only pllcon register name: pllcon address: 0xffff0414 default value: 0x21 access: read and write table 65. pllcon mmr bit designations bit value name description 7:6 reserved. 5 osel 32 khz pll input selection. set by the user to use the internal 32 khz oscillator. set by default. cleared by the user to use the external 32 khz crystal. 4:2 reserved. 1:0 mdclk clocking modes. 00 reserved. 01 pll. default configuration. 10 reserved. 11 external clock on the p1.4/pwm1/eclk/xclk/plai[8] pin. powkeyx registers name: powkey1 address: 0xffff0404 default value: 0x0000 access: write only name: powkey2 address: 0xffff040c default value: 0x0000 access: write only powcon register name: powcon address: 0xffff0408 default value: 0x0003 access: read and write table 66. powcon mmr bit designations bit value name description 7 reserved. 6:4 pc operating modes. 000 active mode. 001 pause mode. 010 nap mode. 011 sleep mode. irq0 to irq3 and timer2 can wake up the ADUC7121. 100 stop mode. others reserved. 3 rsvd reserved. 2:0 cd cpu clock divider bits. 000 41.779200 mhz. 001 20.889600 mhz. 010 10.444800 mhz. 011 5.222400 mhz. 100 2.611200 mhz. 101 1.305600 mhz. 110 654.800 khz. 111 326.400 khz. table 67. pllcon and powcon write sequence pllcon powcon pllkey1 = 0xaa powkey1 = 0x01 pllcon = 0x01 powcon = user value pllkey2 = 0x55 powkey2 = 0xf4
ADUC7121 rev. 0 | page 50 of 96 digital peripherals pwm general overview the ADUC7121 integrates a 6-channel pwm interface. the pwm outputs can be configured to drive an h-bridge or can be used as standard pwm outputs. on power-up, the pwm outputs default to h-bridge mode. this ensures that the motor is turned off by default. in standard pwm mode, the outputs are arranged as three pairs of pwm pins. users have control over the period of each pair of outputs and over the duty cycle of each individual output. in all modes, the pwmxcomx mmrs control the point at which the pwm outputs change state. an example of the first pair of pwm outputs (pwm1 and pwm2) is shown in figure 33 . high side (pwm1) low side (pwm2) pwm1com3 pwm1com2 pwm1com1 pwm1len 0 9492-033 figure 33. pwm timing the pwm clock is selectable via pwmcon1 with one of the following values: uclk divide-by-2, 4, 8, 16, 32, 64, 128, or 256. the length of a pwm period is defined by pwmxlen. the pwm waveforms are set by the count value of the 16-bit timer and the compare registers contents as shown with the pwm1 and pwm2 waveforms above. the low-side waveform, pwm2, goes high when the timer count reaches pwm1len, and it goes low when the timer count reaches the value held in pwm1com3 or when the high-side waveform pwm1 goes low. the high-side waveform, pwm1, goes high when the timer count reaches the value held in pwm1com1, and it goes low when the timer count reaches the value held in pwm1com2. table 68. pwm mmrs name function pwmcon1 pwm control pwm1com1 compare register 1 for pwm output 1 and pwm output 2 pwm1com2 compare register 2 for pwm output 1 and pwm output 2 pwm1com3 compare register 3 for pwm output 1 and pwm output 2 pwm1len frequency control for pwm output 1 and pwm output 2 pwm2com1 compare register 1 for pwm output 3 and pwm output 4 pwm2com2 compare register 2 for pwm output 3 and pwm output 4 pwm2com3 compare register 3 for pwm output 3 and pwm output 4 pwm2len frequency control for pwm output 3 and pwm output 4 pwm3com1 compare register 1 for pwm output 5 and pwm output 6 pwm3com2 compare register 2 for pwm output 5 and pwm output 6 pwm3com3 compare register 3 for pwm output 5 and pwm output 6 pwm3len frequency control for pwm output 5 and pwm output 6 pwmcon2 pwm convert start control pwmiclr pwm interrupt clear
ADUC7121 rev. 0 | page 51 of 96 table 69. pwmcon1 mmr bit designations (a ddress = 0xffff0f80, default value = 0x0012) bit name description 15 reserved this bit is reserved. 14 sync enables pwm synchronization. set to 1 by the user so that all pwm counters are reset on the next clock edge after the detection of a high-to-low transition on sync of the p0.3/miso/plao[12]/sync pin. cleared by the user to ignore transitions on sync of the p0.3/miso/plao[12]/sync pin. 13 pwm6inv set to 1 by the user to invert pwm6. cleared by the user to use pwm6 in normal mode. 12 pwm4nv set to 1 by the user to invert pwm4. cleared by the user to use pwm4 in normal mode. 11 pwm2inv set to 1 by the user to invert pwm2. cleared by the user to use pwm2 in normal mode. 10 pwmtrip set to 1 by the user to enable pwm trip interrupt. when the pwmtrip input is low, the pwmen bit is cleared and an interrupt is generated. cleared by the user to disable the pwmtrip interrupt. 9 ena if hoff = 0 and hmode = 1. if hoff = 1 and hmode = 1, see table 70 . if not in h-bridge mode, this bit has no effect. set to 1 by the user to enable pwm outputs. cleared by the user to disable pwm outputs. 8:6 pwmcp[2:0] pwm clock prescaler bits. sets the uclk divider. 000 = uclk divide-by-2. 001 = uclk divide-by-4. 010 = uclk divide-by-8. 011 = uclk divide-by-16. 100 = uclk divide-by-32. 101 = uclk divide-by-64. 110 = uclk divide-by-128. 111 = uclk divide-by-256. 5 poinv set to 1 by the user to invert all pwm outputs. cleared by the user to use pwm outputs as normal. 4 hoff high-side off. set to 1 by the user to force pwm1 and pwm3 o utputs high. this also forces pwm2 and pwm4 low. cleared by the user to us e the pwm outputs as normal. 3 lcomp load compare registers. set to 1 by the user to load the internal compare registers with the values in pwmxcomx on the next transition of the pwm timer from 0x00 to 0x01. cleared by the user to use the values previou sly stored in the internal compare registers. 2 dir direction control. set to 1 by the user to enable pwm1 and pwm2 as the output signals while pwm3 and pwm4 are held low. cleared by the user to enable pwm3 and pwm4 as the output signals while pwm1 and pwm2 are held low. 1 hmode enables h-bridge mode. set to 1 by the user to enable h-bridge mode and bits[5:2] of pwmcon1. cleared by the user to operate the pwms in standard mode. 0 pwmen set to 1 by the user to enable all pwm outputs. cleared by the user to disable all pwm outputs.
ADUC7121 rev. 0 | page 52 of 96 in h-bridge mode, hmode = 1 and table 69 determine the pwm outputs, as listed in table 70 . table 70. pwm output selection pwmcom1 mmr pwm outputs ena hoff poinv dir pwm1 pwm2 pwmr3 pwm4 0 0 x 1 x 1 1 1 1 1 x 1 1 x 1 x 1 1 0 1 0 1 0 0 0 0 0 hs 1 ls 1 1 0 0 1 hs 1 ls 1 0 0 1 0 1 0 hs 1 ls 1 1 1 1 0 1 1 1 1 hs 1 ls 1 1 hs is high side, ls is low side, x is a dont care bit. on power-up, pwmcon1 defaults to 0x12 (hoff = 1 and hmode = 1). all gpio pins associated with the pwm are configured in pwm mode by default (see table 71 ). table 71. compare register (default value = 0x0000, access is read/write) name address default value access pwm1com1 0xffff0f84 0x0000 r/w pwm1com2 0xffff0f88 0x0000 r/w pwm1com3 0xffff0f8c 0x0000 r/w pwm2com1 0xffff0f94 0x0000 r/w pwm2com2 0xffff0f98 0x0000 r/w pwm2com3 0xffff0f9c 0x0000 r/w pwm3com1 0xffff0fa4 0x0000 r/w pwm3com2 0xffff0fa8 0x0000 r/w pwm3com3 0xffff0fac 0x0000 r/w the pwm trip interrupt can be cleared by writing any value to the pwmiclr mmr. note that when using the pwm trip inter- rupt, users should make sure that the pwm interrupt has been cleared before exiting the isr. this prevents generation of multiple interrupts. pwm convert start control the pwm can be configured to generate an adc convert start signal after the active low side signal goes high. there is a program- mable delay between when the low-side signal goes high and the convert start signal is generated. this is controlled via the pwmcon2 mmr. if the delay selected is higher than the width of the pwm pulse, the interrupt remains low. table 72. pwmcon2 mmr bit designations (address = 0xffff0fb4, default value = 0x00) bit name value description 7 csen set to 1 by the user to enable the pwm to generate a convert start signal. cleared by the user to disable the pwm convert start signal. csd3 to csd0 convert start delay. delays the convert start signal by a number of clock pulses. 0000 4 clock pulses. 0001 8 clock pulses. 0010 12 clock pulses. 0011 16 clock pulses. 0100 20 clock pulses. 0101 24 clock pulses. 0110 28 clock pulses. 0111 32 clock pulses. 1000 36 clock pulses. 1001 40 clock pulses. 1010 44 clock pulses. 1011 48 clock pulses. 1100 52 clock pulses. 1101 56 clock pulses. 1110 60 clock pulses. 3:0 1111 64 clock pulses. when calculating the time from the convert start delay to the start of an adc conversion, the user needs to take account of internal delays. the following example shows the case for a delay of four clocks. one additional clock is required to pass the convert start signal to the adc logic. when the adc logic receives the convert start signal, an adc conversion begins on the next adc clock edge (see figure 34 ). uclock low side count pwm signal s ignal passed to adc logic 09492-034 to convst figure 34. adc conversion
ADUC7121 rev. 0 | page 53 of 96 general-purpose input/output the ADUC7121 provides 32 general-purpose, bidirectional input/output (gpio) pins. all i/o pins are 5 v tolerant, meaning that the gpios support an input voltage of 5 v. in general, many of the gpio pins have multiple functions (see table 73 ). by default, the gpio pins are configured in gpio mode. all gpio pins have an internal pull-up resistor (of about 100 k) and their drive capability is 1.6 ma. note that a maximum of 20 gpios can drive 1.6 ma at the same time. the 32 gpios are grouped into four ports: port 0 to port 3. each port is controlled by four or five mmrs, with x representing the port number. gpxcon registers name: gp0con address: 0xffff0d00 default value: 0x11000000 access: read and write name: gp1con address: 0xffff0d04 default value: 0x00000000 access: read and write name: gp2con address: 0xffff0d08 default value: 0x00000000 access: read and write name: gp3con address: 0xffff0d0c default value: 0x00000000 access: read and write the input level of any gpio can be read at any time in the gpxdat mmr, even when the pin is configured in a mode other than gpio. the pla input is always active. when the ADUC7121 device enters a power-saving mode, the gpio pins retain their state. gpxcon is the port x control register, and it selects the function of each pin of port x, as described in table 73 .
ADUC7121 rev. 0 | page 54 of 96 table 73. gpio pin function designations configuration (see gpxcon table 74 ) port pin 00 01 10 11 0 p0.0 gpio scl0 plai[5] p0.1 gpio sda0 jtag disabled plai[4] p0.2 gpio spiclk jtag disabled adc busy plao[13] p0.3 gpio miso sync (pwm) plao[12] p0.4 gpio mosi trip (pwm) plai[11] p0.5 gpio cs adc convst plai[10] p0.6 gpio mrst plai[2] p0.7 gpio trst plai[3] 1 p1.0 gpio sin scl1 plai[7] p1.1 gpio sout sda1 plai[6] p1.2 1 tdi (jtag) plao[15] p1.3 1 tdo (jtag) plao[14] p1.4 gpio pwm1 eclk/xclk plai[8] p1.5 gpio pwm2 plai[9] p1.6 gpio plao[5] p1.7 gpio plao[4] 2 p2.0 gpio/irq0 plai[13] p2.1 gpio/irq1 plai[12] p2.2 gpio plai[1] p2.3 gpio/irq2 plai[14] p2.4 gpio pwm5 plao[7] p2.5 gpio pwm6 plao[6] p2.6 gpio/irq3 plai[15] p2.7 gpio plai[0] 3 p3.0 gpio plao[0] p3.1 gpio plao[1] p3.2 gpio/irq4 pwm3 plao[2] p3.3 gpio/irq5 pwm4 plao[3] p3.4 gpio plao[8] p3.5 gpio plao[9] p3.6 gpio plao[10] p3.7 gpio/ bm plao[11] 1 reconfiguring these pins disa bles jtag mode. erase part to reenable jt ag access after chan ging default value.
ADUC7121 rev. 0 | page 55 of 96 table 74. gpxcon mmr bit designations bit description 31:30 reserved 29:28 select function of the px.7 pin 27:26 reserved 25:24 select function of the px.6 pin 23:22 reserved 21:20 select function of the px.5 pin 19:18 reserved 17:16 select function of the px.4 pin 15:14 reserved 13:12 select function of the px.3 pin 11:10 reserved 9:8 select function of the px.2 pin 7:6 reserved 5:4 select function of the px.1 pin 3:2 reserved 1:0 select function of the px.0 pin gpxpar registers the gpxpar registers program the parameters for port 0, port 1, port 2, and port 3. note that the gpxdat mmr must always be written after changing the gpxpar mmr. name: gp0par address: 0xffff0d2c default value: 0x20000000 access: read and write name: gp1par address: 0xffff0d3c default value: 0x00000000 access: read and write name: gp2par address: 0xffff0d4c default value: 0x00000000 access: read and write name: gp3par address: 0xffff0d5c default value: 0x00222222 access: read and write table 75. gpxpar mmr bit designations bit description 31:29 reserved 28 pull-up disable px.7 pin set to 1 to enable the pull-up clear to 0 to disable the pull-up 27:25 reserved 24 pull-up disable px.6 pin 23:21 reserved 20 pull-up disable px.5 pin 19:17 reserved 16 pull-up disable px.4 pin 15:13 reserved 12 pull-up disable px.3 pin 11:9 reserved 8 pull-up disable px.2 pin 7:5 reserved 4 pull-up disable px.1 pin 3:1 reserved 0 pull-up disable px.0 pin gpxdat register gpxdat is a port x configuration and data register. it configures the direction of the gpio pins of port x, sets the output value for the pins configured as output, and receives and stores the input value of the pins configured as inputs. name: gp0dat address: 0xffff0d20 default value: 0x000000xx access: read and write name: gp1dat address: 0xffff0d30 default value: 0x000000xx access: read and write name: gp2dat address: 0xffff0d40 default value: 0x000000xx access: read and write
ADUC7121 rev. 0 | page 56 of 96 name: gp3dat address: 0xffff0d50 default value: 0x000000xx access: read and write table 76. gpxdat mmr bit designations bit description 31:24 direction of the data. set to 1 by the user to co nfigure the gpio pin as an output. cleared to 0 by the user to configure the gpio pin as an input. 23:16 port x data output. 15:8 reflect the state of port x pins at reset (read only). 7:0 port x data input (read only). gpxset registers the gpxset registers provide a data set for the port x registers. name: gp0set address: 0xffff0d24 default value: 0x000000xx access: write only name: gp1set address: 0xffff0d34 default value: 0x000000xx access: write only name: gp2set address: 0xffff0d44 default value: 0x000000xx access: write only name: gp3set address: 0xffff0d54 default value: 0x000000xx access: write only table 77. gpxset mmr bit designations bit description 31: 24 reserved. 23:16 data port x set bit. set to 1 by the user to set th e bit on port x; also sets the corresponding bit in the gpxdat mmr. cleared to 0 by user; does not affect the data out. 15:0 reserved. gpxclr registers the gpxclr registers are data clear for port x registers. name: gp0clr address: 0xffff0d28 default value: 0x000000xx access: write only name: gp1clr address: 0xffff0d38 default value: 0x000000xx access: write only name: gp2clr address: 0xffff0d48 default value: 0x000000xx access: write only name: gp3clr address: 0xffff0d58 default value: 0x000000xx access: write only table 78. gpxclr mmr bit designations bit description 31:24 reserved. 23:16 data port x clear bit. set to 1 by the user to clear bit on port x; also clears the corresponding bit in the gpxdat mmr. cleared to 0 by user; does not affect the data output. 15:0 reserved. gpxoce registers open-collector functionality is available on the following gpio pins: p1.7, p1.6, port 2, and port 3.
ADUC7121 rev. 0 | page 57 of 96 table 79. gpxoce mmr bit designations bit description 31:8 reserved. 7 gpio px.7 open collector enable. set to 1 by the user to enable the open collector. set to 0 by the user to disable the open collector. 6 gpio px.6 open collector enable. set to 1 by the user to enable the open collector. set to 0 by the user to disable the open collector. 5 gpio px.5 open collector enable. set to 1 by the user to enable open collector. set to 0 by the user to disable the open collector. 4 gpio px.4 open collector enable. set to 1 by the user to enable open collector. set to 0 by the user to disable the open collector. 3 gpio px.3 open collector enable. set to 1 by the user to enable open collector. set to 0 by the user to disable the open collector. 2 gpio px.2 open collector enable. set to 1 by the user to enable open collector. set to 0 by the user to disable the open collector. 1 gpio px.1 open collector enable. set to 1 by the user to enable open collector. set to 0 by the user to disable the open collector. 0 gpio px.0 open collector enable. set to 1 by the user to enable open collector. set to 0 by the user to disable the open collector.
ADUC7121 rev. 0 | page 58 of 96 uart serial interface the ADUC7121 features a 16,450-compatible uart. the uart is a full-duplex, universal, asynchronous receiver/transmitter. a uart performs serial-to-parallel conversion on data characters received from a peripheral device, and parallel-to-serial conver- sion on data characters received from the arm7tdmi. the uart features a fractional divider that facilitates high accuracy baud rate generation. the uart functionality is available on the p1.0/sin/scl1/plai[7] and p1.1/sout/sda1/plai[6] pins of the ADUC7121. the serial communication adopts an asynchronous protocol that supports various word length, stop bits, and parity genera- tion options selectable in the configuration register. baud rate generation the ADUC7121 features two methods of generating the uart baud rate: normal 450 uart baud rate generation and ADUC7121 fractional divider. normal 450 uart baud rate generation the baud rate is a divided version of the core clock using the value in comdiv0 and comdiv1 mmrs (16-bit value, dl). the standard baud rate generator formula is dl ratebaud = 216 mhz78.41 (1) table 80 lists common baud rate values. table 80. baud rate using the standard baud rate generator baud rate dl actual baud rate % error 9600 0x88 9600 0% 19,200 0x44 19,200 0% 115,200 0x0b 118,691 3% fractional divider the fractional divider combined with the normal baud rate generator allows the generating of a wider range of more accurate baud rates. /16dl uart fben core clock /2 /(m + n/2048) 0 9492-035 figure 35. baud rate generation options calculation of the baud rate using fractional divider is as follows: ) 2048 (216 mhz78.41 n mdl ratebaud + = 216 mhz78.41 2048 =+ dl ratebaud n m for example, generation of 19,200 baud 2671619200 mhz78.41 2048 =+ 015.1 2048 =+ where: m = 1 n = 0.015 2048 = 30 ( ) 2048 30 126716 mhz78.41 + = ratebaud where baud rate = 19,219 bps. uart register definition the uart interface consists of the following ten registers: ? comtx: 8-bit transmit register ? comrx: 8-bit receive register ? comdiv0: divisor latch (low byte) ? comdiv1: divisor latch (high byte) ? comcon0: line control register ? comcon1: line control register ? comsta0: line status register ? comien0: interrupt enable register ? comiid0: interrupt identification register ? comdiv2: 16-bit fractional baud divide register comtx, comrx, and comdiv0 share the same address location. comtx and comrx can be accessed when bit 7 in the comcon0 register is cleared. comdiv0 can be accessed when bit 7 of comcon0 is set.
ADUC7121 rev. 0 | page 59 of 96 uart tx register write to this 8-bit register to transmit data using the uart. name: comtx address: 0xffff0800 access: write only uart rx register this 8-bit register is read from to receive data transmitted using the uart. name: comrx address: 0xffff0800 default value: 0x00 access: read only uart divisor latch register 0 this 8-bit register contains the least significant byte of the divisor latch that controls the baud rate at which the uart operates. name: comdiv0 address: 0xffff0800 default value: 0x00 access: read and write uart divisor latch register 1 this 8-bit register contains the most significant byte of the divisor latch that controls the baud rate at which the uart operates. name: comdiv1 address: 0xffff0804 default value: 0x00 access: read and write uart control register 0 this 8-bit register controls the operation of the uart in conjunction with comcon1. name: comcon0 address: 0xffff080c default value: 0x00 access: read and write
ADUC7121 rev. 0 | page 60 of 96 table 81. comcon0 mmr bit designations bit name description 7 dlab divisor latch access. set by the user to enable access to comdiv0 and comdiv1 registers. cleared by the user to disable access to comd iv0 and comdiv1 and enable access to comrx, comtx, and comien0. 6 brk set break. set by the user to force the transmit pin (sout) to 0. cleared to operate in normal mode. 5 sp stick parity. set by the user to force parity to defined values. 1 if eps = 1 and pen = 1. 0 if eps = 0 and pen = 1. 4 eps even parity select bit. set for even parity. cleared for odd parity. 3 pen parity enable bit. set by the user to trans mit and check the parity bit. cleared by the user for no parity transmission or checking. 2 stop stop bit. set by the user to transmit 1.5 stop bits if the word length is five bits, or two stop bits if the word length is six, seven, or eight bits. the receiver checks the first stop bit only, regardless of the number of stop bits selected. cleared by the user to generate one stop bit in the transmitted data. 1 to 0 wls word length select. 00 = five bits. 01 = six bits. 10 = seven bits. 11 = eight bits. uart control register 1 this 8-bit register controls the operation of the uart in conjunction with comcon0. name: comcon1 address: 0xffff0810 default value: 0x00 access: read and write table 82. comcon1 mmr bit designations bit name description 7:5 reserved bits. not used. 4 loopback loopback. set by the user to enable loopback mode. in loopback mode, sout is forced high. 3:2 reserved bits. not used. 1 rts request to send. set by the user to force the rts output to 0. cleared by the user to force the rts output to 1. 0 dtr data terminal ready. set by the user to force the dtr output to 0. cleared by the user to force the dtr output to 1.
ADUC7121 rev. 0 | page 61 of 96 uart status register 0 name: comsta0 address: 0xffff0814 default value: 0x60 access: read only function: this 8-bit read-only register reflects the current status on the uart. table 83. comsta0 mmr bit designations bit name description 7 reserved. 6 temt comtx and shift register empty status bit. set automatically if comtx and the shift register are empty. this bit indicates that the data has been transmitted, that is, no more da ta is present in the shift register. cleared automatically when writing to comtx. 5 thre comtx empty status bit. set automatically if comtx is empty. comtx can be written as soon as this bit is set; the previous data might not have been transmitted yet and can still be present in the shift register. cleared automatically when writing to comtx. 4 bi break indicator. set when sin of the p1.0/sin/scl1/plai[7] pin is held low for more than the maximum word length. cleared automatically. 3 fe framing error. set when the stop bit is invalid. cleared automatically. 2 pe parity error. set when a parity error occurs. cleared automatically. 1 oe overrun error. set automatically if data are overwritten before being read. cleared automatically. 0 dr data ready. set automatically when comrx is full. cleared by reading comrx.
ADUC7121 rev. 0 | page 62 of 96 uart interrupt enable register 0 this 8-bit register enables and disables the individual uart interrupt sources. name: comien0 address: 0xffff0804 default value: 0x00 access: read and write table 84. comien0 mmr bit designations bit name description 7 to 3 reserved. not used. cleared by the user. 2 elsi receive pin (sin) status interrupt enable bit. set by the user to enable generation of an interrupt if any of the comsta0[3:1] register bits are set. cleared by the user. 1 etbei enable transmit buffer empty interrupt. set by the user to enable an interrupt when the buffer is empty during a transmission, that is, when comsta[5] is set. cleared by the user. 0 erbfi enable receive buffer full interrupt. set by the user to enable an interrupt when the buffer is full during a reception. cleared by the user. uart interrupt identification register 0 this 8-bit register reflects the source of the uart interrupt. name: comiid0 address: 0xffff0808 default value: 0x01 access: read only table 85. comiid0 mmr bit designations bits[2:1] status bits bit 0 nint priority definition clearing operation 00 1 no interrupt 11 0 1 receive line status interrupt read comsta0 10 0 2 receive buffer full interrupt read comrx 01 0 3 transmit buffer empty interrupt write data to comtx or read comiid0 00 0 4 modem status interrupt read comsta1 register uart fractional divider register this 16-bit register controls the operation of the fractional divider for the ADUC7121. name: comdiv2 address: 0xffff082c default value: 0x0000 access: read and write table 86. comdiv2 mmr bit designations bit name description 15 fben fractional baud rate generator enable bit. set by the user to enable the fractional baud rate generator. cleared by the user to generate the baud rate using the standard 450 uart baud rate generator. 14:13 reserved. 12:11 fbm[1:0] m. if fbm = 0, m = 4. see equation 2 for the calculation of the baud rate using a fractional divider and table 80 for common baud rate values. 10:0 fbn[10:0] n. see equation 2 for the calculation of the baud rate using a fractional divider and table 80 for common baud rate values.
ADUC7121 rev. 0 | page 63 of 96 i 2 c peripherals the ADUC7121 incorporates two i 2 c peripherals that may be configured as a fully i 2 c-compatible bus master device or as a fully i 2 c-compatible bus slave device. both peripherals are identical. the two pins used for data transfer, sda and scl, are configured in a wired-and format that allows arbitration in a multimaster system. these pins require external pull-up resistors. typical pull-up values are between 4.7 k and 10 k. the address of the i 2 c bus peripheral in the i 2 c bus system is programmed by the user. this id can be modified any time a transfer is not in progress. the user can configure the interface to respond to four slave addresses. the transfer sequence of an i 2 c system consists of a master device initiating a transfer by generating a start condition while the bus is idle. the master transmits the slave device address and the direction of the data transfer (r/ w ) during the initial address transfer. if the master does not lose arbitration and the slave acknowledges, the data transfer is initiated. this continues until the master issues a stop condition and the bus becomes idle. the i 2 c peripheral can only be configured as a master or slave at any given time. the same i 2 c channel cannot simultaneously support master and slave modes. the i 2 c interface on the ADUC7121 includes the following features: ? support for repeated start condi tions. in master mode, the ADUC7121 can be programmed to generate a repeated start. in slave mode, the ADUC7121 recognizes repeated start conditions. ? in master and slave modes, the device recognizes both 7-bit and 10-bit bus addresses. ? in i 2 c master mode, the ADUC7121 supports continuous reads from a single slave up to 512 bytes in a single transfer sequence. ? clock stretching is supported in both master and slave modes. ? in slave mode, the ADUC7121 can be programmed to return a no acknowledge. this allows the validation of checksum bytes at the end of i 2 c transfers. ? bus arbitration in master mode is supported. ? internal and external loopback modes are supported for i 2 c hardware testing in loopback mode. ? the transmit and receive circui ts in both master and slave mode contain 2-byte fifos. status bits are available to the user to control these fifos. configuring external pins for i 2 c functionality the i 2 c pins of the ADUC7121 device are p0.0 and p0.1 for i 2 c0, and p1.0 and p1.1 for i 2 c1. p0.0 and p1.0 are the i 2 c clock signals, and p0.1 and p1.1 are the i 2 c data signals. for instance, to configure the i 2 c0 pins (scl0, sda0), bit 0 and bit 4 of the gp0con register must be set to 1 to enable i 2 c mode. to configure the i 2 c1 pins (scl1, sda1), bit 1 and bit 5 of the gp1con register must be set to 1 to enable i 2 c mode, as shown in the general-purpose input/output section. serial clock generation the i 2 c master in the system generates the serial clock for a transfer. the master channel can be configured to operate in fast mode (400 khz) or standard mode (100 khz). the bit rate is defined in the i2cdiv mmr as follows: ) (2 )2( divl divh +++ = uclk clock serial f f where: f uclk = clock before the clock divider. divh = the high period of the clock. divl = the low period of the clock. thus, for 100 khz operation divh = divl = 0xcf and for 400 khz divh = 0x28, divl = 0x3c the i2cdiv register corresponds to divh:divl. i 2 c bus addresses slave mode in slave mode, the registers i2cxid0, i2cxid1, i2cxid2, and i2cxid3 contain the device ids. the device compares the four i2cxidx registers to the address byte received from the bus master. to be correctly addressed, the 7 msbs of either id register must be identical to that of the 7 msbs of the first received address byte. the lsb of the id registers (the transfer direction bit) is ignored in the process of address recognition. the ADUC7121 also supports 10-bit addressing mode. when bit 1 of i2cxscon (adr10en bit) is set to 1, then one 10-bit address is supported in slave mode and is stored in registers i2cxid0 and i2cxid1. the 10-bit address is derived as follows: i2cxid0[0] is the read/ write bit and is not part of the i 2 c address. ? i2cxid0[7:1] = address bits[6:0]. ? i2cxid1[2:0] = address bits[9:7]. ? i2cxid1[7:3] must be set to 11110b. master mode in master mode, the i2cxadr0 register is programmed with the i 2 c address of the device. in 7-bit address mode, i2cxadr0[7:1] are set to the device address. i2cxadr0[0] is the read/ write bit. in 10-bit address mode, the 10-bit address is created as follows: ? i2cxadr0[7:3] must be set to 11110b. ? i2cxadr0[2:1] = address bits[9:8]. ? i2cxadr1[7:0] = address bits[7:0].
ADUC7121 rev. 0 | page 64 of 96 ? i2cxadr0[0] is the read/ write bit. i 2 c registers the i 2 c peripheral interfaces consists of a number of mmrs. these are described in the following section. i 2 c master registers i 2 c master control register this 16-bit mmr configures i 2 c peripheral in master mode. name: i2c0mctl, i2c1mctl address: 0xffff0880, 0xffff0900 default value: 0x0000, 0x0000 access: read/write table 87. i2cxmctl mmr bit designations bit name description 15:9 reserved. these bits are reserved; do not write to these bits. 8 i2cmceni i 2 c transmission complete interrupt enable bit. set this bit to enable an interrup t on detecting a stop condition on the i 2 c bus. clear this interrupt source. 7 i2cnackeni i 2 c no acknowledge received interrupt enable bit. set this bit to enable interrupts when the i 2 c master receives a no acknowledge. clear this interrupt source. 6 i2caleni i 2 c arbitration lost interrupt enable bit. set this bit to enable interrupts when the i 2 c master has been unsuccessful in gaining control of the i 2 c bus. clear this interrupt source. 5 i2cmteni i 2 c transmit interrupt enable bit. set this bit to enable interrupts when the i 2 c master has transmitted a byte. clear this interrupt source. 4 i2cmreni i 2 c receive interrupt enable bit. set this bit to enable interrupts when the i 2 c master receives data. cleared by the user to disable interrupts when the i 2 c master is receiving data. i2cmsen i 2 c master scl stretch enable bit. set this bit to 1 to enable clock stretching. when scl is lo w, setting this bit forces the device to hold scl low until i2cmsen is cleared. if scl is high, setting this bit forces the device to hold scl low after the next falling edge. 3 clear this bit to disable clock stretching. 2 i2cilen i 2 c internal loopback enable. set this bit to enable loopback test mode. in this mode, the scl and sda sign als are connected internally to their respective input signals. cleared by the user to disable loopback mode. 1 i2cbd i 2 c master back off disable bit. set this bit to allow the device to compete for control of the bus even if another device is currently driving a start condition. clear this bit to back off until the i 2 c bus becomes free. 0 i2cmen i 2 c master enable bit. set by the user to enable i 2 c master mode. clear this bit to disable i 2 c master mode.
ADUC7121 rev. 0 | page 65 of 96 i 2 c master status register this 16-bit mmr is i 2 c status register in master mode. name: i2c0msta, i2c1msta address: 0xffff0884, 0xffff0904 default value: 0x0000, 0x0000 access: read only table 88 i2cxmsta mmr bit designations bit name description 15:11 reserved. these bits are reserved. 10 i2cbbusy i 2 c bus busy status bit. this bit is set to 1 when a start condition is detected on the i 2 c bus. this bit is cleared when a stop condition is detected on the bus. 9 i2cmrxfo master receiver (rx) fifo overflow. this bit is set to 1 when a byte is writte n to the rx fifo when it is already full. this bit is cleared in all other conditions. 8 i2cmtc i 2 c transmission complete status bit. this bit is set to 1 when a transmission is complete between the master and the slave with which it was communicating. if the i2cmceni bit in i2cxmctl is set, an interrupt is generated when the i2cmtc bit is set. clear this interrupt source. 7 i2cmna i 2 c master no acknowledge data bit. this bit is set to 1 when a no acknowledge condition is receiv ed by the master in response to a data write transfer. if the i2cnackeni bit in i2cxmctl is set, an inte rrupt is generated when the i2cmna bit is set. this bit is cleared in all other conditions. 6 i2cmbusy i 2 c master busy status bit. set to 1 when the master is busy processing a transaction. cleared if the master is ready or if an other master device has control of the bus. 5 i2cal i 2 c arbitration lost status bit. this bit is set to 1 when the i 2 c master is unsuccessful in gaining control of the i 2 c bus. if the i2caleni bit in i2cxmctl is set, an interrupt is ge nerated when the i2cal bit is set. this bit is cleared in all other conditions. i2cmna i 2 c master no acknowledge address bit. this bit is set to 1 when a no acknowledge condition is re ceived by the master in response to an address. if the i2cnackeni bit in i2cxmctl is set, an interr upt is generated when the i2cmna bit is set. 4 this bit is cleared in all other conditions. 3 i2cmrxq i 2 c master receive request bit. this bit is set to 1 when data enters the rx fifo. if th e i2cmreni in i2cxmctl is set, an interrupt is generated. this bit is cleared in all other conditions. 2 i2cmtxq i 2 c master transmit request bit. this bit goes high if the transmitter (tx) fifo is empty or only contains one byte and the master has transmitted an address + write. if the i2cmteni bit in i2cxmctl is set, an interrupt is generated when the i2cmtxq bit is set. this bit is cleared in all other conditions. 1:0 i2cmtfsta i 2 c master tx fifo status bits. 00 = i 2 c master tx fifo empty. 01 = one byte in master tx fifo. 10 = one byte in master tx fifo. 11 = i 2 c master tx fifo full.
ADUC7121 rev. 0 | page 66 of 96 i 2 c master receive registers this 8-bit mmr is the i 2 c master receive register. name: i2c0mrx, i2c1mrx address: 0xffff0888, 0xffff0908 default value: 0x00 access: read only i 2 c master transmit registers this 8-bit mmr is the i 2 c master transmit register. name: i2c0mtx, i2c1mtx address: 0xffff088c, 0xffff090c default value: 0x00 access: write only i 2 c master read count registers this 16-bit mmr holds the required number of bytes when the master begins a read sequence from a slave device. name: i2c0mcnt0, i2c1mcnt0 address: 0xffff0890, 0xffff0910 default value: 0x0000 access: read and write table 89. i2cxmcnt0 mmr bit descriptions bit name description 15:9 reserved. 8 i2crecnt set this bit if greater than 256 bytes are required from the slave. clear this bit when reading 256 bytes or less. 7:0 i2crcnt these 8 bits hold the number of bytes required during a slave read sequence, minus 1. if only a single byte is required, set these bits to 0. i 2 c master current read count registers this 8-bit mmr holds the number of bytes received so far during a read sequence with a slave device. name: i2c0mcnt1, i2c1mcnt1 address: 0xffff0894, 0xffff0914 default value: 0x00 access: read only i 2 c address 0 registers this 8-bit mmr holds the 7-bit slave address + the read/ write bit when the master begins communicating with a slave. name: i2c0adr0, i2c1adr0 address: 0xffff0898, 0xffff0918 default value: 0x00 access: read and write table 90. i2cxadr0 mmr in 7-bit address mode bit name description 7:1 i2cadr these bits contain the 7-bit address of the required slave device. 0 r/ w bit 0 is the read/ write bit. when this bit = 1, a read sequence is requested. when this bit = 0, a write sequence is requested. table 91. i2cxadr0 mmr in 10-bit address mode bit name description 7:3 these bits must be set to [11110b] in 10-bit address mode. 2:1 i2cmadr these bits contain addr[9:8] in 10-bit addressing mode. 0 r/ w read/ write bit. when this bit = 1, a read sequence is requested. when this bit = 0, a write sequence is requested. i 2 c address 1 register this 8-bit mmr is used in 10-bit addressing mode only. this register contains the least significant byte of the address. name: i2c0adr1, i2c1adr1 address: 0xffff089c, 0xffff091c default value: 0x00 access: read and write table 92. i2cxadr1 mmr in 10-bit address mode bit name description 7:0 i2cladr these bits contain addr[7:0] in 10-bit addressing mode.
ADUC7121 rev. 0 | page 67 of 96 i 2 c master clock control register this mmr controls the frequency of the i 2 c clock generated by the master on to the scl pin. name: i2c0div, i2c1div address: 0xffff08a4, 0xffff0924 default value: 0x1f1f access: read and write table 93. i2cxdiv mmr bit name description 15:8 divh these bits control the duration of the high period of scl. 7:0 divl these bits control the duration of the low period of scl. i 2 c slave registers i 2 c slave control register this 16-bit mmr configures the i 2 c peripheral in slave mode. name: i2c0sctl, i2c1sctl address: 0xffff08a8, 0xffff0928 default value: 0x0000 access: read and write
ADUC7121 preliminary technical data rev. 0 | page 68 of 96 table 94. i2cxsctl mmr bit designations bit name description 15:11 reserved bits. 10 i2cstxeni slave transmit interrupt enable bit. set this bit to enable an interrupt after a slave transmits a byte. clear this interrupt source. 9 i2csrxeni slave receive interrupt enable bit. set this bit to enable an inte rrupt after the slave receives data. clear this interrupt source. 8 i2csseni i 2 c stop condition detected interrupt enable bit. set this bit to enable an interrup t on detecting a stop condition on the i 2 c bus. clear this interrupt source. 7 i2cnacken i 2 c no acknowledge enable bit. set this bit to no acknowledge the ne xt byte in the transmission sequence. clear this bit to let the hardware control the acknowledge/no acknowledge sequence. 6 i2cssen i 2 c slave scl stretch enable bit. set this bit to 1 to enable clock stretching. when scl is lo w, setting this bit forces the device to hold scl low until i2cssen is cleared. if scl is high, setting this bit forces the device to hold scl low after the next falling edge. clear this bit to disable clock stretching. 5 i2cseten i 2 c early transmit inte rrupt enable bit. setting this bit enables a transmit request interrupt ju st after the positive edge of scl during the read bit transmission. clear this bit to enable a transmit request interrupt just after the negative edge of scl during the read bit transmission. 4 i2cgcclr i 2 c general call status and id clear bit. writing a 1 to this bit clears the general ca ll status and id bits in the i2cxssta register. clear this bit at all other times. i2chgcen i 2 c hardware general call enable. hardware general call enable. when this bit and bit 2 are set, and having received a general call (address 0x00) and a data byte, the device checks the contents of the i2calt against the receive register. if the contents match, the device has received a hardware general call. this is used if a device needs urgent attention from a master device without knowing which master it needs to turn to. this is a to whom it may concern call. the ADUC7121 watches for these addresses. the device that requires attention embeds its own address into the message. all masters listen, and the one that can handle the device contacts its slave and acts appropriately. the lsb of the i2cxalt register should always be written to 1, as per the i 2 c january 2000 bus specification. set this bit and i2cgcen to enable hardware general call recognition in slave mode. 3 clear to disable recognition of hardware general call commands. 2 i2cgcen i 2 c general call enable. set this bit to enable the slave device to acknowledge an i 2 c general call, address 0x00 (write). the device then recognizes a data bit. if it re ceives a 0x06 (reset and write programmable part of the slave address by hardware) as the data byte, the i 2 c interface resets as per the i 2 c january 2000 bus specification. this command can be used to reset an entire i 2 c system. if it receives a 0x04 (write programmable part of the slave address by hardware) as the data byte, the general call inte rrupt status bit sets on any general call. the user must take corrective action by reprogramming the device address. set this bit to allow the slave acknowledge i 2 c general call commands. clear to disable recognition of general call commands. 1 reserved always set this bit to 0. 0 i2csen i 2 c slave enable bit. set by the user to enable i 2 c slave mode. clear to disable i 2 c slave mode.
ADUC7121 rev. 0 | page 69 of 96 i 2 c slave status registers these 16-bit mmrs are the i 2 c status registers in slave mode. name: i2c0ssta, i2c1ssta address: 0xffff08ac, 0xffff092c default value: 0x0000, 0x0000 access: read and write table 95. i2cxssta mmr bit designations bit name description 15 reserved bit. 14 i2csta this bit is set to 1 if: a start condition followed by a matching address is detected. a start byte (0x01) is received. general calls are enabled and a general call code of (0x00) is received. this bit is cleared on receiving a stop condition. 13 i2creps this bit is set to 1 if a repeated start condition is detected. this bit is cleared on receiving a stop condition. 12:11 i2cid[1:0] i 2 c address matching register. these bits indicate which i2cxidx register matches the received address. [00] = received address matches i2cxid0. [01] = received address matches i2cxid1. [10] = received address matches i2cxid2. [11] = received address matches i2cxid3. 10 i2css i 2 c stop condition after start detected bit. this bit is set to 1 when a stop condition is detected afte r a previous start and matching address. when the i2csseni bit in i2cxsctl is set, an interrupt is generated. this bit is cleared by reading this register. 9:8 i2cgcid[1:0] i 2 c general call id bits. [00] = no general call received. [01] = general call reset and program address. [10] = general program address. [11] = general call matching alternative id. clear these bits by writing a 1 to the i2cgcclr bit in i2cx sctl. note that these bits are not cleared by a general call reset command. 7 i2cgc i 2 c general call status bit. this bit is set to 1 if the slave receives a general call command of any type. if the command received was a reset command, all registers return to their default state. if the command received was a hardware general call, the rx fifo holds the second byte of the command and th is can be compared with the i2cxalt register. clear this bit by writing a 1 to the i2cgcclr bit in i2cxsctl. 6 i2csbusy i 2 c slave busy status bit. set to 1 when the slave receives a start condition. cleared by hardware under the following conditions: the received address does not match any of the i2cxidx registers. the slave device receives a stop condition. a repeated start address does not match any of the i2cxidx registers. 5 i2csna i 2 c slave no acknowledge data bit. this bit sets to 1 when the slave responds to a bus address with a no acknowledge. this bit is asserted under the following conditions: if no acknowledge was returned because there was no data in the tx fifo. if the i2cnacken bit was set in the i2cxsctl register. this bit is cleared in all other conditions.
ADUC7121 rev. 0 | page 70 of 96 bit name description 4 i2csrxfo slave rx fifo overflow. this bit is set to 1 when a byte is writte n to the rx fifo when it is already full. this bit is cleared in all other conditions. i2csrxq i 2 c slave receive request bit. this bit is set to 1 when the rx fifo of the slave is not empty. this bit causes an interrupt to occur if the i2csrxeni bit in i2cxsctl is set. 3 the rx fifo must be read or flushed to clear this bit. 2 i2cstxq i 2 c slave transmit request bit. this bit is set to 1 when the slave receives a matching address followed by a read. if the i2cseten bit in i2cxsctl is = 0, this bit goes high just after the nega tive edge of scl during the read bit transmission. if the i2cseten bit in i2cxsctl is = 1, this bit goes hi gh just after the positive edge of scl during the read bit transmission. this bit causes an interrupt to occur if the i2cstxeni bit in i2cxsctl is set. this bit is cleared in all other conditions. 1 i2cstfe i 2 c slave fifo underflow status bit. this bit is high if the tx fifo is empty when a master requ ests data from the slave. this bit asserts at the rising edge of scl during the read bit. this bit clears in all other conditions. 0 i2cetsta i 2 c slave early transmit fifo status bit. if the i2cseten bit in i2cxsctl is = 0, this bit goes high if the slave tx fifo is empty. if the i2cseten bit in i2cxsctl is = 1, this bit goes hi gh just after the positive edge of scl during the write bit transmission. this bit asserts once only for a transfer. this bit is cleared after being read.
ADUC7121 rev. 0 | page 71 of 96 i 2 c slave receive registers this 8-bit mmr is the i 2 c slave receive register. name: i2c0srx, i2c1srx address: 0xffff08b0, 0xffff0930 default value: 0x00 access: read only i 2 c slave transmit registers this 8-bit mmr is the i 2 c slave transmit register. name: i2c0stx, i2c1stx address: 0xffff08b4, 0xffff0934 default value: 0x00 access: write only i 2 c hardware general call recognition registers this 8-bit mmr is used with hardware general calls when i2cxsctl bit 3 is set to 1. this register is used in cases where a master is unable to generate an address for a slave, and instead, the slave must generate the address for the master. name: i2c0alt, i2c1alt address: 0xffff08b8, 0xffff0938 default value: 0x00 access: read and write i 2 c slave device id registers i2c0idx registers these eight i2c0idx 8-bit mmrs are programmed with i 2 c bus ids of the slave. see the section i2c bus addresses for further details. name: i2c0id0 address: 0xffff08bc default value: 0x00 access: read and write name: i2c0id1 address: 0xffff08c0 default value: 0x00 access: read and write name: i2c0id2 address: 0xffff08c4 default value: 0x00 access: read and write name: i2c0id3 address: 0xffff08c8 default value: 0x00 access: read and write name: i2c1id0 address: 0xffff093c default value: 0x00 access: read and write name: i2c1id1 address: 0xffff0940 default value: 0x00 access: read and write name: i2c1id2 address: 0xffff0944 default value: 0x00 access: read and write name: i2c1id3 address: 0xffff0948 default value: 0x00 access: read and write
ADUC7121 rev. 0 | page 72 of 96 i 2 c common registers i 2 c fifo status registers these 16-bit mmrs contain the status of the rx/tx fifos in both master and slave modes. name: i2c0fsta address: 0xffff08cc default value: 0x0000 access: read and write name: i2c1fsta address: 0xffff094c default value: 0x0000 access: read and write table 96. i2cxfsta mmr bit designations bit name description 15:10 reserved bits. 9 i2cfmtx set this bit to 1 to flush the master tx fifo. 8 i2cfstx set this bit to 1 to flush the slave tx fifo. 7:6 i2cmrxsta i 2 c master receive fifo status bits. [00] = fifo empty. [01] = byte written to fifo. [10] = one byte in fifo. [11] = fifo full. 5:4 i2cmtxsta i 2 c master transmit fifo status bits. [00] = fifo empty. [01] = byte written to fifo. [10] = one byte in fifo. [11] = fifo full. 3:2 i2csrxsta i 2 c slave receive fifo status bits. [00] = fifo empty. [01] = byte written to fifo. [10] = one byte in fifo. [11] = fifo full. 1:0 i2cstxsta i 2 c slave transmit fifo status bits. [00] = fifo empty. [01] = byte written to fifo. [10] = one byte in fifo. [11] = fifo full.
ADUC7121 rev. 0 | page 73 of 96 serial peripheral interface the ADUC7121 integrates a complete hardware serial peri- pheral interface (spi) on-chip. spi is an industry standard, synchronous serial interface that allows eight bits of data to be synchronously transmitted and simultaneously received, that is, full duplex up to a maximum bit rate of 20 mbps. the spi port can be configured for master or slave operation and typically consists of four pins: p0.3/miso/plao[12]/sync, p0.4/mosi/plai[11]/trip, p0.2/spiclk/adc busy /plao[13], and p0.5/ cs /plai[10]/ adc convst . spi miso (master in, slave out) pin miso on the p0.3/miso/plao[12]/sync pin is configured as an input line in master mode and an output line in slave mode. connect the miso line on the master (data in) to the miso line in the slave device (data out). the data is transferred as byte wide (8-bit) serial data, msb first. spi mosi (master out, slave in) pin mosi on the p0.4/mosi/plai[11]/trip pin is configured as an output line in master mode and an input line in slave mode. the mosi line on the master (data out) should be connected to the mosi line in the slave device (data in). the data is transferred as byte wide (8-bit) serial data, msb first. spiclk (serial clock i/o) pin the master serial clock (spiclk) synchronizes the data being transmitted and received through the mosi spiclk period. therefore, a byte is transmitted/received after eight spiclk periods. the p0.2/spiclk/adc busy /plao[13] pin is configured as an output in master mode and as an input in slave mode. in master mode, the polarity and phase of the clock are controlled by the spicon register, and the bit rate is defined in the spidiv register as follows: )1(2 spidiv f f uclk clock serial + = the maximum speed of the spi clock is independent on the clock divider bits. in slave mode, the spicon register must be configured with the phase and polarity of the expected input clock. the slave accepts data from an external master up to 10 mbps. in both master and slave modes, data is transmitted on one edge of the spiclk signal and sampled on the other. therefore, it is important that the polarity and phase are configured the same for the master and slave devices. spi chip select input pin in spi slave mode, a transfer is initiated by the assertion of cs on the p0.5/ cs /plai[10]/adc convst pin. cs is an active low input signal. the spi port then transmits and receives 8-bit data until the transfer is concluded by deassertion of cs . in slave mode, cs is always an input. in spi master mode, cs is an active low output signal. it asserts itself automatically at the beginning of a transfer and deasserts itself upon completion. configuring external pins for spi functionality the spi pins of the ADUC7121 device are p0.2 to p0.5. ? p0.5/ cs /plai[10]/adc convst is the slave chip select pin. in slave mode, this pin is an input and must be driven low by the master. in master mode, this pin is an output and goes low at the beginning of a transfer and high at the end of a transfer. ? p0.2/spiclk/adc busy /plao[13] is the spiclk pin. ? p0.3/miso/plao[12]/sync is th e master in, slave out pin. ? p0.4/mosi/plai[11]/trip is the master out, slave in pin. to configure p0.2 to p0.5 for spi mode, see the general-purpose input/output section. spi registers the following mmr registers control the spi interface: spista, spirx, spitx, spidiv, and spicon. spi status register this 32-bit mmr contains the status of the spi interface in both master and slave modes. name: spista address: 0xffff0a00 default value: 0x0000 access: read only
ADUC7121 rev. 0 | page 74 of 96 table 97. spista mmr bit designations bit name description 15:12 reserved bits. 11 spirex spi rx fifo excess bytes present. this bit is set when th ere are more bytes in the rx fifo than indicated in the spimde bits in spicon. this bit is cleared when the number of bytes in the fifo is equal or less than the number in spimde. 10:8 spirxfsta[2:0] spi rx fifo status bits. [000] = rx fifo is empty. [001] = one valid byte in the fifo. [010] = two valid bytes in the fifo. [011] = three valid bytes in the fifo. [100] = four valid bytes in the fifo. 7 spifof spi rx fifo overflow status bit. set when the rx fifo was already full when new data was loaded to the fifo. this bit generates an interrupt except when spirflh is set in spicon. cleared when the spista register is read. 6 spirxirq spi rx irq status bit. set when a receive interrupt occurs. this bit is set when spitmde in spicon is cleared and the required number of bytes have been received. cleared when the spista register is read. spitxirq spi tx irq status bit. set when a transmit interrupt occurs. this bit is set when spitmde in spicon is set and the required number of bytes have been transmitted. 5 cleared when the spista register is read. 4 spitxuf spi tx fifo underflow. this bit is set when a transmit is initiated without any va lid data in the tx fifo. this bit generates an interrupt except when spitflh is set in spicon. cleared when the spista register is read. 3:1 spitxfsta[2:0] spi tx fifo status bits. [000] = tx fifo is empty. [001] = one valid byte in the fifo. [010] = two valid bytes in the fifo. [011] = three valid bytes in the fifo. [100] = four valid bytes in the fifo. 0 spiista spi interrupt status bit. set to 1 when an spi based interrupt occurs. cleared after reading spista. spirx register this 8-bit mmr is the spi receive register. name: spirx address: 0xffff0a04 default value: 0x00 access: read only spitx register this 8-bit mmr is the spi transmit register. name: spitx address: 0xffff0a08 default value: 0x00 access: write only spidiv register this 8-bit mmr is the spi baud rate selection register. name: spidiv address: 0xffff0a0c default value: 0x00 access: read and write spi control register this 16-bit mmr configures the spi peripheral in both master and slave modes. name: spicon address: 0xffff0a10 default value: 0x0000 access: read and write
ADUC7121 rev. 0 | page 75 of 96 table 98. spicon mmr bit designations bit name description 15:14 spimde spi irq mode bits. these bits configur e when the tx/rx interrupts occur in a transfer. [00] = tx interrupt occurs when one byte has been transferred. rx interrupt occurs when one or more bytes have been received into the fifo. [01] = tx interrupt occurs when two bytes has been transferred. rx interrupt occurs when two or more bytes have been received into the fifo. [10] = tx interrupt occurs when three bytes has been tran sferred. rx interrupt occurs when three or more bytes have been received into the fifo. [11] = tx interrupt occurs when four bytes has been transfer red. rx interrupt occurs when the rx fifo is full, or four bytes present. 13 spitflh spi tx fifo flush enable bit. set this bit to flush the tx fifo. this bit does not clear itself and should be toggl ed if a single flush is required. if thi s bit is left high, then either the last trans mitted value or 0x00 is transmitted dependin g on the spizen bit. any writes to the tx fifo are ignored while this bit is set. clear this bit to disable tx fifo flushing. 12 spirflh spi rx fifo flush enable bit. set this bit to flush the rx fifo. this bit does not clear itself and should be toggl ed if a single flush is required. if thi s bit is set, all incoming data is ignored and no interrupts are generated. if this bit is set and spitmde = 0, a read of the rx fifo initiates a transfer. clear this bit to disable rx fifo flushing. continuous transfer enable. set by the user to enable continuous transfer. in master mode , the transfer continues until no valid data is available in the tx register. the p0.5/ cs /plai[10]/adc convst pin is asserted and remains asserted for the duration of each 8-bit serial transfer until tx is empty. 11 spicont cleared by the user to disable continuous transfer. each transfer consists of a sing le 8-bit serial transfer. if valid data exists in the spitx register, then a new transfer is in itiated after a stall period of one serial clock cycle. 10 spilp loopback enable bit. set by the user to connect miso to mosi and test software. cleared by the user to be in normal mode. 9 spioen slave miso output enable bit. set this bit for normal operation of miso. clear this bit to disable the output dr iver on the miso pin. the miso pin is open drain when this bit is clear. 8 spirow spirx overflow overwrite enable. set by the user, the valid data in the rx register is overwritten by the new serial byte that is received. cleared by the user, the new serial byte that is received is discarded. 7 spizen spi transmits zeros when tx fifo is empty. set this bit to transmit 0x00 when th ere is no valid data in the tx fifo. clear this bit to transmit the last transmitted value when there is no valid data in the tx fifo. 6 spitmde spi transfer and interrupt mode. set by the user to initiate a transfer with a write to the spitx register. interrupt occurs only when tx is empty. cleared by the user to initiate a transfer with a read of the spirx register. interrupt occurs only when rx is full. 5 spilf lsb first transfer enable bit. set by the user, the lsb is transmitted first. cleared by the user, the msb is transmitted first. 4 spiwom spi wired or mode enable bit. set to 1 to enable open-drain data output enable. external pull-ups are required on data output pins. clear for normal output levels. serial clock polarity mode bit. set by the user, the serial clock idles high. 3 spicpo cleared by the user, the serial clock idles low. 2 spicph serial clock phase mode bit. set by the user, the serial clock pulses at the beginning of each serial bit transfer. cleared by the user, the serial clock pulses at the end of each serial bit transfer. 1 spimen master mode enable bit. set by the user to enable master mode. cleared by the user to enable slave mode. 0 spien spi enable bit. set by the user to enable the spi. cleared by the user to disable the spi.
ADUC7121 rev. 0 | page 76 of 96 programmable logic array (pla) the ADUC7121 integrates a fully programmable logic array (pla) that consists of two independent but interconnected pla blocks. each block consists of eight pla elements, giving each part a total of 16 pla elements. each pla element contains a dual input lookup table that can be configured to generate any logic output function based on two inputs and a flip-flop. this is represented in figure 36 . 09492-036 4 2 0 1 3 a b lookup table figure 36. pla element in total, 32 gpio pins are available on each ADUC7121 for the pla. these include 16 input pins and 16 output pins, which need to be configured in the gpxcon register as pla pins before using the pla. note that the comparator output is also included as one of the 16 input pins, and that the jtag tdi and tdo pins are included as pla outputs. if you want to use jtag program- ming or debugging, then you cannot use the jtag tdi and tdo pins as pla outputs. the pla is configured via a set of user mmrs. the output(s) of the pla can be routed to the internal interrupt system, to the adc convst signal of the adc, to an mmr, or to any of the 16 pla output pins. the two blocks can be interconnected as follows: ? output of element 15 (block 1) can be fed to input 0 of mux 0 of element 0 (block 0). ? output of element 7 (block 0) can be fed to the input 0 of mux 0 of element 8 (block 1). table 99. element input/output pla block 0 pla block 1 element input output element input output 0 p2.7 p3.0 8 p1.4 p3.4 1 p2.2 p3.1 9 p1.5 p3.5 2 p0.6 p3.2 10 p0.5 p3.6 3 p0.7 p3.3 11 p0.4 p3.7 4 p0.1 p1.7 12 p2.1 p0.3 5 p0.0 p1.6 13 p2.0 p0.2 6 p1.1 p2.5 14 p2.3 p1.3 7 p1.0 p2.4 15 p2.6 p1.2
ADUC7121 rev. 0 | page 77 of 96 pla mmrs interface the pla peripheral interface consists of the 21 mmrs described in the following sections. plaelmx registers plaelmx are element 0 to element 15 control registers. they configure the input and output mux of each element, select the function in the look-up table, and bypass/use the flip-flop. see table 101 and table 104 . table 100. plaelmx mmr addresses (default value = 0x0000, access is read/write) name address plaelm0 0xffff0b00 plaelm1 0xffff0b04 plaelm2 0xffff0b08 plaelm3 0xffff0b0c plaelm4 0xffff0b10 plaelm5 0xffff0b14 plaelm6 0xffff0b18 plaelm7 0xffff0b1c plaelm8 0xffff0b20 plaelm9 0xffff0b24 plaelm10 0xffff0b28 plaelm11 0xffff0b2c plaelm12 0xffff0b30 plaelm13 0xffff0b34 plaelm14 0xffff0b38 plaelm15 0xffff0b3c table 101. plaelmx mmr bit descriptions bit value description 31:11 reserved. 10:9 mux 0 control (see table 104 ). 8:7 mux 1 control (see table 104 ). 6 mux 2 control. set by the user to select the output of mux 0. cleared by the user to select the bit value from pladin. 5 mux 3 control. set by the user to select the input pin of the particular element. cleared by the user to select the output of mux 1. 4:1 look up table control. 0000 0. 0001 nor. 0010 b and not a. 0011 not a. 0100 a and not b. 0101 not b. 0110 exor. 0111 nand. 1000 and. 1001 exnor. 1010 b. 1011 not a or b. 1100 a. 1101 a or not b. 1110 or. 1111 1. 0 mux 4 control. set by the user to bypass the flip-flop. cleared by the user to select the flip-flop (cleared by default). table 102. feedback configuration bit value plaelm0 plaelm1 to plaelm7 plaelm8 plaelm9 to plaelm15 10:9 00 element 15 element 0 element 7 element 8 01 element 2 element 2 element 10 element 10 10 element 4 element 4 element 12 element 12 11 element 6 element 6 element 14 element 14 8:7 00 element 1 element 1 element 9 element 9 01 element 3 element 3 element 11 element 11 10 element 5 element 5 element 13 element 13 11 element 7 element 7 element 15 element 15
ADUC7121 rev. 0 | page 78 of 96 placlk register placlk is the clock selection for the flip-flops of block 0 and block 1. the maximum frequency when using the gpio pins as the clock input for the pla blocks is 41.78 mhz. name: placlk address: 0xffff0b40 default value: 0x00 access: read and write table 103. placlk mmr bit descriptions bit value description 7 reserved. 6:4 block 1 clock source selection. 000 gpio clock on p0.5 of the p0.5/ cs /plai[10]/ adc convst pin. 001 gpio clock on p0.0 of the p0.0/scl0/plai[5] pin. 010 gpio clock on the p0.7 of the p0.7/ trst /plai[3] pin. 011 hclk (core clock). 100 oclk (32.768 khz external crystal). 101 timer1 overflow. other reserved. 3 reserved. 2:0 block 0 clock source selection. 000 gpio clock on p0.5. on p0.5 of the p0.5/ cs / plai[10]/adc convst pin. 001 gpio clock on p0.0 of the p0.0/scl0/plai[5] pin. 010 gpio clock on p0.7 of the p0.7/ trst /plai[3] pin. 011 hclk (core clock). 100 oclk (32.768 khz external crystal). 101 timer1 overflow. other reserved. plairq register plairq enables irq0 and/or irq1 and selects the source of the normal interrupt request irq (irq). name: plairq address: 0xffff0b44 default value: 0x0000 access: read and write table 104. plairq mmr bit descriptions bit value description 15:13 reserved. 12 pla irq1 enable bit. set by the user to enable irq1 output from the pla. cleared by the user to disable irq1 output from the pla. bit value description 11:8 pla irq1 source. 0000 pla element 0. 0001 pla element 1. 1111 pla element 15. 7:5 reserved. 4 pla irq0 enable bit. set by the user to enable irq0 output from the pla. cleared by the user to disable irq0 output from the pla. 3:0 pla irq0 source. 0000 pla element 0. 0001 pla element 1. 1111 pla element 15. plaadc register plaadc is the pla source for the adc start conversion signal. name: plaadc address: 0xffff0b48 default value: 0x00000000 access: read and write table 105. plaadc mmr bit descriptions bit value description 31:5 reserved. 4 adc start conversion enable bit. set by the user to enable an adc start conversion from the pla. cleared by the user to disable an adc start conversion from the pla. 3:0 adc start conversion source. 0000 pla element 0. 0001 pla element 1. 1111 pla element 15. pladin register pladin is a data input mmr for pla. name: pladin address: 0xffff0b4c default value: 0x00000000 access: read and write table 106. pladin mmr bit descriptions bit description 31:16 reserved. 15:0 input bit from element 15 to element 0.
ADUC7121 rev. 0 | page 79 of 96 pladout register pladout is a data output mmr for pla. this register is always updated. name: pladout address: 0xffff0b50 default value: 0x00000000 access: read only table 107. pladout mmr bit descriptions bit description 31:16 reserved. 15:0 output bit from elem ent 15 to element 0. plalck register plalck is a pla lock option. bit 0 is written only once. when set, it does not allow modifying any of the pla mmrs, except pladin. a pla tool is provided in the development system to easily configure the pla. name: plalck address: 0xffff0b54 default value: 0x00 access: write only
ADUC7121 rev. 0 | page 80 of 96 interrupt system table 108. irq/fiq mmrs bit designations bit description comments 0 all interrupts ored (fiq only) this bit is set if any fiq is active 1 software interrupt user programmable interrupt source 2 timer0 general-purpose timer0 3 timer1 general-purpose timer1 4 timer2 or wake-up timer general-purpose timer2 or wake-up timer 5 timer3 or watchdog timer general-purpose timer3 or watchdog timer 6 timer4 general-purpose timer4 7 idac fault idac fault irq 8 psm power supply monitor 9 undefined this bit is not used 10 flash control 0 flash controller for block 0 interrupt 11 flash control 1 flash controller for block 1 interrupt 12 adc adc interrupt source bit 13 uart uart interrupt source bit 14 spi spi interrupt source bit 15 i 2 c0 master irq i 2 c master interrupt source bit 16 i 2 c0 slave irq i 2 c slave interrupt source bit 17 i 2 c1 master irq i 2 c master interrupt source bit 18 i 2 c1 slave irq i 2 c slave interrupt source bit 19 xirq0 (gpio irq0 ) external interrupt 0 20 xirq1 (gpio irq1) external interrupt 1 21 xirq2 (gpio irq2 ) external interrupt 2 22 xirq3 (gpio irq3) external interrupt 3 23 pwm pwm trip interrupt source bit 24 xirq4 (gpio irq4 ) external interrupt 4 25 xirq5 (gpio irq5) external interrupt 5 26 pla irq0 pla block 0 irq bit 27 pla irq1 pla block 1 irq bit there are 27 interrupt sources on the ADUC7121 that are con- trolled by the interrupt controller. all interrupts are generated from the on-chip peripherals, except for the software interrupt (swi), which is programmable by the user. the arm7tdmi cpu core recognizes interrupts as one of two types only: a normal interrupt request (irq) and a fast interrupt request (fiq). all the interrupts can be masked separately. the control and configuration of the interrupt system is managed through a number of interrupt related registers. the bits in each irq and fiq register represent the same interrupt source as described in table 108 . the ADUC7121 contains a vectored interrupt controller (vic) that supports nested interrupts up to eight levels. the vic also allows the programmer to assign priority levels to all interrupt sources. interrupt nesting needs to be enabled by setting the enirqn bit in the irqconn register. a number of extra mmrs are used when the full-vectored interrupt controller is enabled. upon entering the interrupt service routine (isr), immediately save irqsta/fiqsta to ensure that all valid interrupt sources are serviced. normal interrupt request (irq) the normal interrupt request (irq) is the exception signal to enter the irq mode of the processor. it services general- purpose interrupt handling of internal and external events. all 32 bits are logically ored to create a single irq signal to the arm7tdmi core. the four 32-bit registers dedicated to irq follow. irqsig register irqsig reflects the status of the different irq sources. if a peripheral generates an irq signal, the corresponding bit in the irqsig is set; otherwise, it is cleared. the irqsig bits clear when the interrupt in the particular peripheral is cleared. all irq sources can be masked in the irqen mmr. irqsig is a read-only register. do not use this register in an interrupt service routine for determining the source of an irq exception; use only irqsta for this purpose.
ADUC7121 rev. 0 | page 81 of 96 name: irqsig address: 0xffff0004 default value: 0x00000000 access: read only irqen register irqen provides the value of the current enable mask. when a bit is set to 1, the corresponding source request is enabled to create an irq exception. when a bit is set to 0, the corre- sponding source request is disabled or masked, which does not create an irq exception. the irqen register cannot be used to disable an interrupt. name: irqen address: 0xffff0008 default value: 0x00000000 access: read and write irqclr register irqclr is a write-only register that allows the irqen register to clear to mask an interrupt source. each bit that is set to 1 clears the corresponding bit in the irqen register without affecting the remaining bits. the pair of registers, irqen and irqclr, allows independent manipulation of the enable mask without requiring an atomic read-modify-write. use this register to disable an interrupt source only when: ? the device is in the interrupt sources interrupt service routine. ? the peripheral is temporarily disabled by its own control register. do not use the irqclr to disable an irq source if that irq source has an interrupt pending or could have an interrupt pending. name: irqclr address: 0xffff000c default value: 0x00000000 access: write only irqsta register irqsta is a read-only register that provides the current enabled irq source status (effectively a logic and of the irqsig and irqen bits). when set to 1, that source generates an active irq request to the arm7tdmi core. there is no priority encoder or interrupt vector generation. this function is implemented in software in a common interrupt handler routine. name: irqsta address: 0xffff0000 default value: 0x00000000 access: read only fast interrupt request (fiq) the fast interrupt request (fiq) is the exception signal to enter the fiq mode of the processor. it is provided to service data transfer or communication channel tasks with low latency. the fiq interface is identical to the irq interface and provides the second level interrupt (highest priority). four 32-bit registers are dedicated to fiq: fiqsig, fiqen, fiqclr, and fiqsta. bit 31 to bit 1 of fiqsta are logically ored to create the fiq signal to the core and to bit 0 of both the fiq and irq registers (fiq source). the logic for fiqen and fiqclr does not allow an interrupt source to be enabled in both irq and fiq masks. a bit set to 1 in fiqen clears, as a side effect, the same bit in irqen. likewise, a bit set to 1 in irqen clears, as a side effect, the same bit in fiqen. an interrupt source can be disabled in both irqen and fiqen masks. fiqsig register fiqsig reflects the status of the different fiq sources. if a peripheral generates an fiq signal the corresponding bit in the fiqsig is set, otherwise it is cleared. the fiqsig bits are cleared when the interrupt in the particular peripheral is cleared. all fiq sources can be masked in the fiqen mmr. fiqsig is read only. name: fiqsig address: 0xffff0104 default value: 0x00000000 access: read only fiqen register fiqen provides the value of the current enable mask. when a bit is set to 1, the corresponding source request is enabled to create an fiq exception. when a bit is set to 0, the corre- sponding source request is disabled or masked, which does not create an fiq exception. the fiqen register cannot be used to disable an interrupt. fiqen register name: fiqen address: 0xffff0108 default value: 0x00000000 access: read and write
ADUC7121 rev. 0 | page 82 of 96 fiqclr fiqclr is a write-only register that allows the fiqen register to clear to mask an interrupt source. each bit that is set to 1 clears the corresponding bit in the fiqen register without affecting the remaining bits. the pair of registers, fiqen and fiqclr, allows independent manipulation of the enable mask without requiring an atomic read-modify-write. use this register to disable an interrupt source only when: ? the device is in the interrupt sources interrupt service routine. ? the peripheral is temporarily disabled by its own control register. do not use this register to disable an fiq source if that fiq source has an interrupt pending or could have an interrupt pending. fiqclr register name: fiqclr address: 0xffff010c default value: 0x00000000 access: write only fiqsta fiqsta is a read-only register that provides the current enabled fiq source status (effectively a logic and of the fiqsig and fiqen bits). when set to 1, that source generates an active fiq request to the arm7tdmi core. there is no priority encoder or interrupt vector generation. this function is implemented in software in a common interrupt handler routine. fiqsta register name: fiqsta address: 0xffff0100 default value: 0x00000000 access: read only programmed interrupts because the programmed interrupts are not maskable, they are controlled by another register (swicfg) that writes into both irqsta and irqsig registers and/or the fiqsta and fiqsig registers at the same time. the 32-bit register dedicated to software interrupt is swicfg described in table 109 . this mmr allows the control of a programmed source interrupt. table 109. swicfg mmr bit designations bit description 31:3 reserved. 2 programmed interrupt fiq. setting/clearing this bit corresponds to setting/clearing bit 1 of fiqsta and fiqsig. 1 programmed interrupt irq1. setting or clearing this bit corresponds to setting or clearing bit 1 of irqsta and irqsig. 0 reserved. any interrupt signal must be active for at least the minimum interrupt latency time, to be detected by the interrupt controller and to be detected by the user in the irqsta/fiqsta register. 09492-037 pointer to function (irqvec) irq_source fiq_source programmable priority per interrupt (irqp0/irqp1/irqp2) internal arbiter logic interrupt vector bit 31 to bit 23 unused bit 1 to bit 0 lsb bit 22 to bit 7 (irqbase) bit 6 to bit 2 highest priority active irq figure 37. interrupt structure vectored interrupt controller (vic) the ADUC7121 incorporates an enhanced interrupt control system or vectored interrupt controller. the vectored interrupt controller for irq interrupt sources is enabled by setting bit 0 of the irqconn register. similarly, bit 1 of irqconn enables the vectored interrupt controller for the fiq interrupt sources. the vectored interrupt controller provides the following enhancements to the standard irq/fiq interrupts: ? vectored interruptsallows a user to define separate interrupt service routine addresses for every interrupt source. this is achieved by using the irqbase and irqvec registers. ? irq/fiq interruptscan be nested up to eight levels depending on the priority settings. an fiq still has a higher priority than an irq. therefore, if the vic is enabled for both the fiq and irq and prioritization is maximized, it is possible to have 16 separate interrupt levels. ? programmable interrupt prioritiesusing the irqp0 to irqp3 registers, an interrupt source can be assigned an interrupt priority level value between 0 and 7.
ADUC7121 rev. 0 | page 83 of 96 vic mmrs irqbase register the vector base register, irqbase, is used to point to the start address of memory used to store 32 pointer addresses. these pointer addresses are the addresses of the individual interrupt service routines. name: irqbase address: 0xffff0014 default value: 0x00000000 access: read and write table 110. irqbase mmr bit designations bit type initial value description 31:16 read only reserved always read as 0 15:0 read and write 0 vector base address irqvec register the irq interrupt vector register, irqvec points to a memory address containing a pointer to the interrupt service routine of the currently active irq. read this register only when an irq occurs and irq interrupt nesting has been enabled by setting bit 0 of the irqconn register. name: irqvec address: 0xffff001c default value: 0x00000000 access: read and write table 111. irqvec mmr bit designations bit type initial value description 31:23 read only 0 always read as 0. 22:7 read and write 0 irqbase register value. 6:2 read only 0 highest priority source. this is a value between 0 and 27 representing the possible interrupt sources. for example, if the highest currently active irq is timer2, these bits are [00100]. 1:0 reserved 0 reserved bits. priority registers irqp0 register name: irqp0 address: 0xffff0020 default value: 0x00000000 access: read and write table 112. irqp0 mmr bit designations bit name description 31 reserved reserved bit. 30:28 idac_fault a priority level of 0 to 7 can be set for an idac fault interrupt. 27 reserved reserved bit. 26:24 t4pi a priority level of 0 to 7 can be set for timer4. 23 reserved reserved bit. 22:20 t3pi a priority level of 0 to 7 can be set for timer3. 19 reserved reserved bit. 18:16 t2pi a priority level of 0 to 7 can be set for timer2. 15 reserved reserved bit. 14:12 t1pi a priority level of 0 to 7 can be set for timer1. 11 reserved reserved bit. 10:8 t0pi a priority level of 0 to 7 can be set for timer0. 7 reserved reserved bit. 6:4 swintp a priority level of 0 to 7 can be set for the software interrupt source. 3:0 reserved reserved bit. irqp1 register name: irqp1 address: 0xffff0024 default value: 0x00000000 access: read and write table 113. irqp1 mmr bit designations bit name description 31 reserved reserved bit. 30:28 i2c0mpi a priority level of 0 to 7 can be set for i 2 c 0 master. 27 reserved reserved bit. 26:24 spipi a priority level of 0 to 7 can be set for spi. 23 reserved reserved bit. 22:20 uartpi a priority level of 0 to 7 can be set for uart. 19 reserved reserved bit. 18:16 adcpi a priority level of 0 to 7 can be set for the adc interrupt source. 15 reserved reserved bit. 14:12 flash1pi a priority level of 0 to 7 can be set for the flash block 1 controller interrupt source. 11 reserved reserved bit. 10:8 flash0pi a priority level of 0 to 7 can be set for the flash block 0 controller interrupt source. 7:3 reserved reserved bits. 2:0 psmpi a priority level of 0 to 7 can be set for the power supply monitor interrupt source.
ADUC7121 rev. 0 | page 84 of 96 irqp2 register name: irqp2 address: 0xffff0028 default value: 0x00000000 access: read and write table 114. irqp2 mmr bit designations bit name description 31 reserved reserved bit. 30:28 pwmpi a priority level of 0 to 7 can be set for pwm. 27 reserved reserved bit. 26:24 irq3pi a priority level of 0 to 7 can be set for irq3. 23 reserved reserved bit. 22:20 irq2pi a priority level of 0 to 7 can be set for irq2. 19 reserved reserved bit. 18:16 irq1pi a priority level of 0 to 7 can be set for irq1. 15 reserved reserved bit. 14:12 irq0pi a priority level of 0 to 7 can be set for irq0. 11 reserved reserved bit. 10:8 i2c1spi a priority level of 0 to 7 can be set for i 2 c1 slave. 7 reserved reserved bit. 6:4 i2c1mpi a priority level of 0 to 7 can be set for i 2 c1 master. 3 reserved reserved bit. 2:0 i2c0spi a priority level of 0 to 7 can be set for i 2 c0 slave. irqp3 register name: irqp3 address: 0xffff002c default value: 0x00000000 access: read and write irqp3 mmr bit designations bit name description 31:15 reserved reserved bit. 14:12 pla1pi a priority level of 0 to 7 can be set for pla0. 11 reserved reserved bit. 10:8 pla0pi a priority level of 0 to 7 can be set for pla0. 7 reserved reserved bit. 6:4 irq5pi a priority level of 0 to 7 can be set for irq5. 3 reserved reserved bit. 2:0 irq4pi a priority level of 0 to 7 can be set for irq4. irqconn register the irqconn register is the irq and fiq control register. it contains two active bits. the first to enable nesting and prioritiza- tion of irq interrupts the other to enable nesting and prioritization of fiq interrupts. if these bits are cleared, then fiqs and irqs can still be used, but it is not possible to nest irqs or fiqs, nor is it possible to set an interrupt source priority level. in this default state, an fiq does have a higher priority than an irq. name: irqconn address: 0xffff0030 default value: 0x00000000 access: read and write table 115. irqconn mmr bit designations bit name description 31:2 reserved these bits are reserved and should not be written to. 1 enfiqn setting this bit to 1 enables nesting of fiq interrupts. clearing this bit means no nesting or prioritization of fiqs is allowed. 0 enirqn setting this bit to 1 enables nesting of irq interrupts. clearing this bit means no nesting or prioritization of irqs is allowed. irqstan register if irqconn.0 is asserted and irqvec is read then one of these bits is asserted. the bit that asserts depends on the priority of the irq. if the irq is of priority 0 then bit 0 asserts, priority 1 then bit 1 asserts, and so forth. when a bit is set in this register, all interrupts of that priority and lower are blocked. to clear a bit in this register, all bits of a higher priority must be cleared first. it is only possible to clear one bit at a time. for example, if this register is set to 0x09 then writing 0xff changes the register to 0x08, and writing 0xff a second time changes the register to 0x00. name: irqstan address: 0xffff003c default value: 0x00000000 access: read and write table 116. irqstan mmr bit designations bit name description 31:8 reserved these bits are reserved and should not be written to. 7:0 setting this bit to 1 enables nesting of fiq interrupts. clearing this bit means no nesting or prioritization of fiqs is allowed.
ADUC7121 rev. 0 | page 85 of 96 fiqvec register the fiq interrupt vector register, fiqvec points to a memory address containing a pointer to the interrupt service routine of the currently active fiq. read this register only when an fiq occurs and fiq interrupt nesting has been enabled by setting bit 1 of the irqconn register. name: fiqvec address: 0xffff011c default value: 0x00000000 access: read only table 117. fiqvec mmr bit designations bit type initial value description 31:23 read only 0 always read as 0. 22:7 read and write 0 irqbase register value. 6:2 0 highest priority source. this is a value between 0 and 27 representing the possible interrupt sources. for example, if the highest currently active fiq is timer2, then these bits are [00100]. 1:0 reserved 0 reserved bits. fiqstan register if irqconn.1 is asserted and fiqvec is read, then one of these bits assert. the bit that asserts depends on the priority of the fiq. if the fiq is of priority 0, then bit 0 asserts; if priority 1, then bit 1 asserts, and so forth. when a bit is set in this register, all interrupts of that priority and lower are blocked. to clear a bit in this register, all bits of a higher priority must be cleared first. it is only possible to clear one bit at a time. for example if this register is set to 0x09 then writing 0xff changes the register to 0x08, and writing 0xff a second time changes the register to 0x00. name: fiqstan address: 0xffff013c default value: 0x00000000 access: read and write table 118. fiqstan mmr bit designations bit name description 31:8 reserved these bits are reserved and should not be written to. 7:0 setting this bit to 1 enables nesting of fiq interrupts. clearing this bit means no nesting or prioritization of fiqs is allowed. external interrupts (irq0 to irq3) the ADUC7121 provides up to six external interrupt sources. these external interrupts can be individually configured as level or rising/falling edge triggered. to enable the external interrupt source, first, the appropriate bit must be set in the fiqen or irqen register. to select the required edge or level to trigger on, the irqcone register must be appropriately configured. to properly clear an edge based external irq interrupt, set the appropriate bit in the irqclre register. irqcone register name: irqcone address: 0xffff0034 default value: 0x00000000 access: read and write table 119. irqconemmr bit designations bit value name description 31:12 reserved these bits are reserved and should not be written to. 11:10 11 irq5src[1:0] external irq5 triggers on falling edge. 10 external irq5 triggers on rising edge. 01 external irq5 triggers on low level. 00 external irq5 triggers on high level. 9:8 11 irq4src[1:0] external irq4 triggers on falling edge. 10 external irq4 triggers on rising edge. 01 external irq4 triggers on low level. 00 external irq4 triggers on high level. 7:6 11 irq3src[1:0] external irq3 triggers on falling edge. 10 external irq3 triggers on rising edge. 01 external irq3 triggers on low level. 00 external irq3 triggers on high level.
ADUC7121 rev. 0 | page 86 of 96 bit value name description 5:4 11 irq2src[1:0] external irq2 triggers on falling edge. 10 external irq2 triggers on rising edge. 01 external irq2 triggers on low level. 00 external irq2 triggers on high level. 3:2 11 irq1src[1:0] external irq1 triggers on falling edge. 10 external irq1 triggers on rising edge. 01 external irq1 triggers on low level. 00 external irq1 triggers on high level. 1:0 11 irq0src[1:0] external irq0 triggers on falling edge. 10 external irq0 triggers on rising edge. 01 external irq0 triggers on low level. 00 external irq0 triggers on high level. irqclre register name: irqclre address: 0xffff0038 default value: 0x00000000 access: read and write table 120. irqclre mmr bit designations bit name description 31:25 reserved these bits are reserved and should not be written to. 24 irq5clri a 1 must be written to this bit in the irq5 interrupt service routine to clear an edge triggered irq5 interrupt. 24 irq4clri a 1 must be written to this bit in the irq4 interrupt service routine to clear an edge triggered irq4 interrupt. 23 reserved this bit is reserved. 22 irq3clri a 1 must be written to this bit in the irq3 interrupt service routine to clear an edge triggered irq3 interrupt. 21 irq2clri a 1 must be written to this bit in the irq2 interrupt service routine to clear an edge triggered irq2 interrupt. 20 irq1clri a 1 must be written to this bit in the irq1 interrupt service routine to clear an edge triggered irq1 interrupt. 19 irq0clri a 1 must be written to this bit in the irqo interrupt service routine to clear an edge triggered irq0 interrupt. 18:0 reserved these bits are reserved and should not be written to.
ADUC7121 rev. 0 | page 87 of 96 timers the ADUC7121 has five general purpose timers/counters. ? timer0 ? timer1 ? timer2 or wake-up timer ? timer3 or watchdog timer ? timer4 the five timers in their normal mode of operation can be either free-running or periodic. in free-running mode, the counter decrements/increments from the maximum/minimum value until zero scale/full scale and starts again at the maximum/minimum value. in periodic mode, the counter decrements/increments from the value in the load register (txld mmr) until zero scale/full scale and starts again at the value stored in the load register. the value of a counter can be read at any time by accessing its value register (txval). timers are started by writing in the control register of the corresponding timer (txcon). in normal mode, an irq is generated each time the value of the counter reaches zero if counting down or full scale if counting up. an irq can be cleared by writing any value to the clear register of the particular timer (txclri). table 121. event selection (es) numbers es interrupt no. name 00000 2 rtos timer (timer0) 00001 3 gp timer0 (timer1) 00010 4 wake-up timer (timer2) 00011 5 watchdog timer (timer3) 00100 6 gp timer4 (timer4) 00101 7 idac fault irq 00110 8 power supply monitor 00111 9 undefined 01000 10 flash block 0 01001 11 flash block 1 01010 12 adc 01011 13 uart 01100 14 spi 01101 15 i 2 c0 master 01110 16 i 2 c0 slave 01111 17 i 2 c1 master 10000 18 i 2 c1 slave 10001 19 external irq0 timer0lifetime timer timer0 is a general-purpose, 48-bit count up, or a 16-bit count up/down timer with a programmable prescaler. timer0 is clocked from the core clock, with a prescaler of 1, 16, 256, or 32,768. this gives a minimum resolution of 22 ns when the core is operating at 41.78 mhz and with a prescaler of one. timer0 can also be clocked from the undivided core clock, internal 32 khz oscillator or external 32 khz crystal. in 48-bit mode, timer0 counts up from zero. the current counter value can be read from t0val0 and t0val1. in 16-bit mode, timer0 can count up or count down. a 16-bit value can be written to t0ld that is loaded into the counter. the current counter value can be read from t0val0. timer0 has a capture register (t0cap) that can be triggered by a selected irqs source initial assertion. when triggered, the current timer value is copied to t0cap, and the timer keeps running. this feature can be used to determine the assertion of an event with more accuracy than by servicing an interrupt alone. timer0 reloads the value from t0ld either when timer0 overflows or immediately when t0iclr is written. timer0 interface consists of six mmrs as listed in table 122 . table 122. timer0 interface mmrs name description t0ld 16-bit register that holds the 16-bit value loaded into the counter. available only in 16-bit mode. t0cap 16-bit register that holds the 16-bit value captured by an enabled irq event. available only in 16-bit mode. t0val0/t0val1 toval0 is a 16-bit register that holds the 16 least significant bits (lsbs). t0val1 is a 32-bit register that holds the 32 most significant bits (msbs). t0val0 and t0val1 are read only. in 16-bit mode, 16-bit t0val0 is used. in 48-bit mode, both 16-bit t0val0 and 32-bit t0val1 are used. t0iclr 8-bit register. writing any value to this register clears the interrupt. av ailable only in 16-bit mode. t0con configuration mmr. timer0 value registers t0val0 and t0val1 are 16-bit and 32-bit registers that hold the 16 least significant bits and 32 most significant bits, respectively. t0val0 and t0val1 are read-only registers. in 16-bit mode, 16-bit t0val0 is used. in 48-bit mode, both 16-bit t0val0 and 32-bit t0val1 are used. name: t0val0 address: 0xffff0304 default value: 0x0000 access: read only name: t0val1 address: 0xffff0308 default value: 0x00000000 access: read only
ADUC7121 rev. 0 | page 88 of 96 timer0 capture register this is a 16-bit register that holds the 16-bit value captured by an enabled irq event; available in 16-bit mode only. name: t0cap address: 0xffff0314 default value: 0x0000 access: read only timer0 control register this 17-bit mmr configures the mode of operation of timer0. name: t0con address: 0xffff030c default value: 0x00000000 access: read and write table 123. t0con mmr bit designations bit value description 31:18 reserved. 17 event select bit. set by the user to enable time capture of an event. cleared by the user to disable time capture of an event. 16:12 event select range, 0 to 16. the events are described in the introduction to the timers section. 11 reserved. 10:9 clock select. 00 internal 32 khz oscillator. 01 uclk. 10 external 32 khz crystal. 11 hclk. 8 count up. available in 16-bit mode only. set by the user for timer0 to count up. cleared by the user for timer0 to count down (default). 7 timer0 enable bit. set by the user to enable timer0. cleared by the user to disable timer0 (default). 6 timer0 mode. set by the user to operate in periodic mode. cleared by the user to operate in free-running mode (default). 5 reserved. timer0 mode of operation. 0 16-bit operation (default). 4 1 48-bit operation. bit value description prescaler. 0000 source clock divide-by-1 (default). 0100 source clock divide-by-16. 1000 source clock divide-by-256. 3:0 1111 source clock divide-by-32,768. timer0 load registers t0ld is a 16-bit register that holds the 16-bit value that is loaded into the counter; available only in 16-bit mode. name: t0ld address: 0xffff0300 default value: 0x00 access: read and write timer0 clear register this 8-bit, write-only mmr is written (with any value) by user code to refresh (reload) timer0. name: t0clri address: 0xffff0310 default value: 0x00 access: write only timer1general-purpose timer timer1 is a 32-bit general-purpose timer, count down or count up, with a programmable prescaler. the prescaler source can be from the 32 khz internal oscillator, the 32 khz external crystal, the core clock, or from the undivided pll clock output. this source can be scaled by a factor of 1, 16, 256, or 32,768. this gives a minimum resolution of 22 ns when operating at cd zero, the core is operating at 41.78 mhz, and with a prescaler of one. the counter can be formatted as a standard 32-bit value or as hours:minutes:seconds:hundreths. timer1 has a capture register (t1cap) that can be triggered by a source initial assertion of a selected irq. when triggered, the current timer value is copied to t1cap, and the timer keeps running. this feature can be used to determine the assertion of an event with increased accuracy. timer1 interface consists of five mmrs as shown in table 1 24 . if the part is in a low power mode and timer1 is clocked from the gpio or low power oscillator source, then timer1 continues to operate. timer1 reloads the value from t1ld either when timer1 overflows or immediately when t1iclr is written.
ADUC7121 rev. 0 | page 89 of 96 table 124. timer1 interface registers register description t1ld 32-bit register. holds 32-bit unsigned integers. this register is read only. t1val 32-bit register. holds 32-bit unsigned integers. t1cap 32-bit register; holds 32-bit unsigned integers. this register is read only. t1clri 8-bit register. writing any value to this register clears the timer1 interrupt. t1con configuration mmr. timer1 load registers t1ld is a 32-bit register that holds the 32-bit value that is loaded into the counter. name: t1ld address: 0xffff0320 default value: 0x00000000 access: read and write timer1 clear register this 8-bit, write-only mmr is written (with any value) by user code to refresh (reload) timer1. name: t1clri address: 0xffff032c default value: 0x00 access: write only timer1 value register t1val is a 32-bit register that holds the current value of timer1. name: t1val address: 0xffff0324 default value: 0x00000000 access: read only timer1 capture register this is a 32-bit register that holds the 32-bit value captured by an enabled irq event. name: t1cap address: 0xffff0330 default value: 0x0000 access: read only timer1 control register this 32-bit mmr configures the mode of operation of timer1. name: t1con address: 0xffff0328 default value: 0x00000000 access: read and write table 125. t1con mmr bit designations bit value description 31:24 8-bit postscaler. 23 enable write to postscaler. 22:20 reserved. 19 postscaler compare flag. 18 t1 interrupt generation selection flag. 17 event select bit. set by the user to enable time capture of an event. cleared by the user to disable time capture of an event. 16:12 event select range, 0 to 16. the events are as described in the introduction to the timers section. clock select. 000 internal 32 khz oscillator (default). 001 core clock. 010 uclk. 11:9 011 p0.6. of the p0.6/ mrst /plai[2] pin. 8 count up. set by the user for timer1 to count up. cleared by the user for timer1 to count down (default). 7 timer1 enable bit. set by the user to enable timer1. cleared by the user to disable timer1 (default). 6 timer1 mode. set by the user to operate in periodic mode. cleared by the user to operate in free-running mode (default). format. 00 binary (default). 01 reserved. 10 hr:min:sec:hundredths: 23 hours to 0 hour. 5:4 11 hr:min:sec:hundredths: 255 hours to 0 hour. prescaler. 0000 source clock divide-by-1 (default). 0100 source clock divide-by-16. 1000 source clock divide-by-256. 3:0 1111 source clock divide-by-32,768.
ADUC7121 rev. 0 | page 90 of 96 timer2wake-up timer timer2 is a 32-bit wake-up timer, count down or count up, with a programmable prescaler. the prescaler is clocked directly from one of four clock sources, namely, the core clock (default selection), the internal 32.768 khz oscillator, the external 32.768 khz watch crystal, or the pll undivided clock. the selected clock source can be scaled by a factor of 1, 16, 256, or 32,768. the wake-up timer continues to run when the core clock is disabled. this gives a minimum resolution of 22 ns when the core is operating at 41.78 mhz and with a prescaler of 1. capture of the current timer value is enabled if the timer2 interrupt is enabled via irqen[4]. the counter can be formatted as a plain 32-bit value or as hours:minutes:seconds:hundreths. timer2 reloads the value from t2ld either when timer2 over- flows or immediately when t2clri is written. the timer2 interface consists of four mmrs, as shown in table 126 . table 126. timer2 interface registers register description t2ld 32-bit register. holds 32-bit unsigned integers. t2val 32-bit register. holds 32-bit unsigned integers. this register is read only. t2clri 8-bit register. writing any value to this register clears the timer2 interrupt. t2con configuration mmr. timer2 load registers t2ld is a 32-bit register, which holds the 32 bit value that is loaded into the counter. name: t2ld address: 0xffff0340 default value: 0x00000000 access: read and write timer2 clear register this 8-bit write-only mmr is written (with any value) by the user code to refresh (reload) timer2. name: t2clri address: 0xffff034c default value: 0x00 access: write only timer2 value register t2val is a 32-bit register that holds the current value of timer2. name: t2val address: 0xffff0344 default value: 0x00000000 access: read only timer2 control register this 32-bit mmr configures the mode of operation for timer2. name: t2con address: 0xffff0348 default value: 0x00000000 access: read and write table 127. t2con mmr bit designations bit value description 31:11 reserved. clock source select. 00 internal 32.768 khz oscillator (default). 01 core clock. 10 external 32.768khz watch crystal. 10:9 11 uclk. 8 count up. set by the user for timer2 to count up. cleared by the user for timer2 to count down (default). 7 timer2 enable bit. set by the user to enable timer2. cleared by the user to disable timer2 (default). 6 timer2 mode. set by the user to operate in periodic mode. cleared by the user to operate in free-running mode (default). format. 00 binary (default). 01 reserved. 10 hr:min:sec:hundredths: 23 hours to 0 hour. 5:4 11 hr:min:sec:hundredths: 255 hours to 0 hour. prescaler. 0000 source clock divide-by-1 (default). 0100 source clock divide-by-16. 1000 source clock divide-by-256. (use this setting in conjunction with timer2 format 1,0 and format 1,1.) 3:0 1111 source clock divide-by-32,768.
ADUC7121 rev. 0 | page 91 of 96 timer3watchdog timer timer3irq 16-bit load 16-bit up/down counter timer3 value prescaler 1, 16, or 256 watchdog reset low power 32.768khz 09492-038 figure 38. timer3 block diagram timer3 has two modes of operation: normal mode and watchdog mode. the watchdog timer is used to recover from an illegal software state. when enabled, it requires periodic servicing to prevent it from forcing a reset of the processor. timer3 reloads the value from t3ld either when timer3 overflows or immediately when t3clri is written. normal mode the timer3 in normal mode is identical to timer0 in 16-bit mode of operation, except for the clock source. the clock source is the 32.768 khz oscillator and can be scaled by a factor of 1, 16, or 256. timer3 also features a capture facility that allows capture of the current timer value if the timer2 interrupt is enabled via irqen[5]. watchdog mode watchdog mode is entered by setting t3con[5]. timer3 decre- ments from the timeout value present in the t3ld register until 0. the maximum timeout is 512 seconds, using the maximum prescaler divide-by-256 and full scale in t3ld. user software should only configure a minimum timeout period of 30 milliseconds. this is to avoid any conflict with flash/ee memory page erase cycles, requiring 20 ms to complete a single page erase cycle and kernel execution. if t3val reaches 0, a reset or an interrupt occurs, depending on t3con[1]. to avoid a reset or an interrupt event, any value must be written to t3iclr before t3val reaches zero. this reloads the counter with t3ld and begins a new timeout period. once watchdog mode is entered, t3ld and t3con are write protected. these two registers cannot be modified until a power- on reset event resets the watchdog timer. after any other reset event, the watchdog timer continues to count. the watchdog timer should be configured in the initial lines of user code to avoid an infinite loop of watchdog resets. timer3 is automatically halted during jtag debug access and only recommences counting once jtag has relinquished control of the arm7 core. by default, timer3 continues to count during power-down. this can be disabled by setting bit 0 in t3con. it is recommended that the default value is used, that is, the watchdog timer continues to count during power-down. timer3 interface timer3 interface consists of four mmrs as shown in table 128 . table 128. timer3 interface registers register description t3con the configuration mmr. t3ld 6-bit register (bit 0 to bit15); holds 16-bit unsigned integers. t3val 6-bit register (bit 0 to bit 15); holds 16-bit unsigned integers. this register is read only. t3clri 8-bit register. writing any value to this register clears the timer3 interrupt in normal mode or resets a new timeout period in watchdog mode. timer3 load register this 16-bit mmr holds the timer3 reload value. name: t3ld address: 0xffff0360 default value: 0x3bf8 access: read and write timer3 value register this 16-bit, read-only mmr holds the current timer3 count value. name: t3val address: 0xffff0364 default value: 0x3bf8 access: read only timer3 clear register this 8-bit, write-only mmr is written (with any value) by user code to refresh (reload) timer3 in watchdog mode to prevent a watchdog timer reset event. name: t3clri address: 0xffff036c default value: 0x0000 access: write only timer3 control register the 16-bit mmr configures the mode of operation of timer3 and is described in detail in table 129 . name: t3con address: 0xffff0368 default value: 0x00 access: read and write one time only
ADUC7121 rev. 0 | page 92 of 96 secure clear bit (watchdog mode only) table 129. t3con mmr bit designations bit value description 16:9 these bits are reserved and should be written as 0s by user code. 8 count up/down enable. set by user code to co nfigure timer3 to count up. cleared by user code to configure timer3 to count down. 7 timer3 enable. set by user code to enable timer3. cleared by user code to disable timer3. 6 timer3 operating mode. set by user code to configure timer3 to operate in periodic mode. cleared by user to configure timer3 to operate in free-running mode. 5 watchdog timer mode enable. set by user code to enable watchdog mode. cleared by user code to disable watchdog mode. 4 secure clear bit. set by the user to use the secure clear option. cleared by the user to disable the secure clear option by default. 3:2 timer3 clock(32.768 khz) prescaler. 00 source clock divide-by-1 (default). 01 reserved. 10 reserved. 11 reserved. 1 watchdog timer irq enable. set by user code to produce an irq instead of a reset when the watchdog reaches 0. cleared by user code to disable the irq option. 0 pd_off. set by user code to stop timer3 when the peripherals are powered down via bit 4 in the powcon mmr. cleared by user code to enable timer3 when the peripherals are powered down via bit 4 in the powcon mmr. the secure clear bit is provided for a higher level of protection. when set, a specific sequential value must be written to t3clri to avoid a watchdog reset. the value is a sequence generated by the 8-bit linear feedback shift re gister (lfsr) polynomial = x8 + x6 + x5 + x + 1. the initial value or seed is written to t3clri before entering watchdog mode. after entering watchdog mode, a write to t3clri must match this expected value. if it matches, the lfsr is advanced to the next state when the counter reload happens. if it fails to match the expected state, reset is immediately generated, even if the count has not yet expired. because of the properties of the polynomial, do not use the value, 0x00, as an initial seed. value 0x00 is always guaranteed to force an immediate reset. the value of the lfsr cannot be read; it must be tracked/generated in software. example of a sequence: 1. enter initial seed, 0xaa, in t3clri before starting timer3 in watchdog mode. 2. enter 0xaa in t3clri; timer3 is reloaded. 3. enter 0x37 in t3clri; timer3 is reloaded. 4. enter 0x6e in t3clri; timer3 is reloaded. 5. enter 0x66. 0xdc was expected; the watchdog resets the chip. clock qd 4 qd 5 qd 3 qd 7 qd 6 qd 2 qd 1 qd 0 09492-039 figure 39. 8-bit lfsr
ADUC7121 rev. 0 | page 93 of 96 timer4general-purpose timer timer4 is a 32-bit general-purpose timer, count down or count up, with a programmable prescaler. the prescaler source can be the 32 khz oscillator, the core clock, or pll undivided output. this source can be scaled by a factor of 1, 16, 256, or 32,768. this gives a minimum resolution of 42 ns when operating at cd zero, the core is operating at 41.78 mhz, and with a prescaler of 1 (ignoring external gpio). the counter can be formatted as a standard 32-bit value or as hours:minutes:seconds:hundreths. timer4 has a capture register (t4cap), which can be triggered by a selected irqs source initial assertion. once triggered, the current timer value is copied to t4cap, and the timer keeps running. this feature can be used to determine the assertion of an event with increased accuracy. timer4 interface consists of five mmrs. ? t 4ld, t4val and t4cap are 32-bit registers and hold 32- bit unsigned integers. t4val and t4cap are read only. ? t 4iclr is an 8-bit register. writing any value to this register clears the timer1 interrupt. ? t4con is the configuration mmr. ? note that if the part is in a low power mode, and timer4 is clocked from the gpio or oscillator source then, timer4 continues to operate. timer4 reloads the value from t4ld either when timer4 overflows, or immediately when t4iclr is written. timer4 load registers t4ld is a 32-bit register, which holds the 32-bit value that is loaded into the counter. name: t4ld address: 0xffff0380 default value: 0x00000000 access: read and write timer4 clear register this 8-bit, write-only mmr is written (with any value) by user code to refresh (reload) timer4. name: t4clri address: 0xffff038c default value: 0x00 access: write only timer4value register t4val is a 32-bit register that holds the current value of timer4. name: t4val address: 0xffff0384 default value: 0x00000000 access: read only timer4 capture register this is a 32-bit register that holds the 32-bit value captured by an enabled irq event. name: t4cap address: 0xffff0390 default value: 0x00000000 access: read only timer4 control register this 32-bit mmr configures the mode of operation of timer4. name: t4con address: 0xffff0388 default value: 0x0000 access: read and write
ADUC7121 rev. 0 | page 94 of 96 table 130. t4con mmr bit designations bit value description 31:18 reserved. set by the user to 0. 17 event select bit. set by the user to enable time capture of an event. cleared by the user to disable time capture of an event. 16:12 event select range, 0 to 31. the events are described in the introduction to the timers section. clock select. 000 32.768 khz oscillator. 001 hclk (core clock). 010 uclk. 11:9 011 uclk. 8 count up. set by the user for timer4 to count up. cleared by the user for timer4 to count down (default). 7 timer4 enable bit. set by the user to enable timer4. cleared by the user to disable timer4 (default). 6 timer4 mode. set by the user to operate in periodic mode. cleared by the user to operate in free-running mode (default). format. 00 binary (default). 01 reserved. 10 hr:min:sec:hundredths: 23 hours to 0 hour. 5:4 11 hr:min:sec:hundredths: 255 hours to 0 hour. prescaler. 0000 source clock divide-by-1 (default). 0100 source clock divide-by-16. 1000 source clock divide-by-256. 3:0 1111 source clock divide-by-32,768.
ADUC7121 rev. 0 | page 95 of 96 outline dimensions 090408-a a 1 ball corner top view ball a1 pad corne r detail a bottom view 7.10 7.00 sq 6.90 seating plane ball diameter coplanarity 0.08 0.50 bsc 5.50 bsc sq detail a 10 11 8 7 6 3 2 1 9 5 4 a b c d e f g j h k l * compliant with jedec standards mo-195-bd with exception to package height and thickness. 0.35 0.30 0.25 * 1.11 max * 1.40 max 0.15 min m 12 figure 40. 108-ball chip scale package ball grid array [csp_bga] (bc-108-4) dimensions shown in millimeters ordering guide model 1 temperature range package description package option ADUC7121bbcz ?10c to +95c 108-ball csp_bga bc-108-4 ADUC7121bbcz-rl ?10c to +95c 108-ball csp_bga, 13 tape and reel bc-108-4 eval-ADUC7121qspz ADUC7121 quickstart development system 1 z = rohs compliant part.
ADUC7121 rev. 0 | page 96 of 96 notes i 2 c refers to a communications protocol originally developed by philips semiconductors (now nxp semiconductors). ?2011 analog devices, inc. all rights reserved. trademarks and registered trademarks are the property of their respective owners. d09492-0-1/11(0)


▲Up To Search▲   

 
Price & Availability of ADUC7121

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X